summaryrefslogtreecommitdiff
path: root/vendor/github.com/playwright-community/playwright-go/cmd/playwright/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/playwright-community/playwright-go/cmd/playwright/main.go')
-rw-r--r--vendor/github.com/playwright-community/playwright-go/cmd/playwright/main.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/github.com/playwright-community/playwright-go/cmd/playwright/main.go b/vendor/github.com/playwright-community/playwright-go/cmd/playwright/main.go
new file mode 100644
index 0000000..95e7d85
--- /dev/null
+++ b/vendor/github.com/playwright-community/playwright-go/cmd/playwright/main.go
@@ -0,0 +1,25 @@
+package main
+
+import (
+ "log"
+ "os"
+
+ "github.com/playwright-community/playwright-go"
+)
+
+func main() {
+ driver, err := playwright.NewDriver(&playwright.RunOptions{})
+ if err != nil {
+ log.Fatalf("could not start driver: %v", err)
+ }
+ if err = driver.DownloadDriver(); err != nil {
+ log.Fatalf("could not download driver: %v", err)
+ }
+ cmd := driver.Command(os.Args[1:]...)
+ cmd.Stdout = os.Stdout
+ cmd.Stderr = os.Stderr
+ if err := cmd.Run(); err != nil {
+ log.Fatalf("could not run driver: %v", err)
+ }
+ os.Exit(cmd.ProcessState.ExitCode())
+}