This commit is contained in:
parent
acc5bcdcfc
commit
b9079e1e55
@ -16,4 +16,4 @@ COPY *.go ./
|
||||
RUN go build -o /vivaplusdl
|
||||
|
||||
RUN /vivaplusdl --install
|
||||
CMD ["/vivaplusdl", "--no-install"]
|
||||
CMD ["/vivaplusdl"]
|
||||
|
9
main.go
9
main.go
@ -12,18 +12,15 @@ import (
|
||||
|
||||
func main() {
|
||||
var err error
|
||||
var noInstall = flag.Bool("no-install", false, "skip browser installation")
|
||||
var onlyInstall = flag.Bool("install", false, "install the required browser and do nothing else")
|
||||
flag.Parse()
|
||||
|
||||
options := &playwright.RunOptions{
|
||||
Browsers: []string{"firefox"},
|
||||
}
|
||||
if !*noInstall {
|
||||
err = playwright.Install(options)
|
||||
if err != nil {
|
||||
log.Panicf("error installing playwright: %v", err)
|
||||
}
|
||||
err = playwright.Install(options)
|
||||
if err != nil {
|
||||
log.Panicf("error installing playwright: %v", err)
|
||||
}
|
||||
|
||||
if *onlyInstall {
|
||||
|
Loading…
x
Reference in New Issue
Block a user