Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

devops: fix `//browser_patches/{build.sh,clean.sh}` scripts (#9515)

Andrey Lushnikovf43ece0a9950
diff --git a/browser_patches/build.sh b/browser_patches/build.sh
index 207e084603..509307f9e0 100755
--- a/browser_patches/build.sh
+++ b/browser_patches/build.sh
@@ -18,20 +18,22 @@ if [[ $# == 0 ]]; then
exit 1
fi
-if [[ ("$1" == "firefox") || ("$1" == "firefox/") || ("$1" == "ff") ]]; then
+CMD="$1"
+shift
+if [[ ("$CMD" == "firefox") || ("$CMD" == "firefox/") || ("$CMD" == "ff") ]]; then
bash ./firefox/build.sh "$@"
-elif [[ ("$1" == "firefox-beta") || ("$1" == "ff-beta") ]]; then
+elif [[ ("$CMD" == "firefox-beta") || ("$CMD" == "ff-beta") ]]; then
bash ./firefox-beta/build.sh "$@"
-elif [[ ("$1" == "webkit") || ("$1" == "webkit/") || ("$1" == "wk") ]]; then
+elif [[ ("$CMD" == "webkit") || ("$CMD" == "webkit/") || ("$CMD" == "wk") ]]; then
bash ./webkit/build.sh "$@"
-elif [[ ("$1" == "chromium") || ("$1" == "chromium/") || ("$1" == "cr") ]]; then
+elif [[ ("$CMD" == "chromium") || ("$CMD" == "chromium/") || ("$CMD" == "cr") ]]; then
bash ./chromium/build.sh "$@"
-elif [[ ("$1" == "winldd") ]]; then
+elif [[ ("$CMD" == "winldd") ]]; then
bash ./winldd/build.sh "$@"
-elif [[ ("$1" == "ffmpeg") ]]; then
+elif [[ ("$CMD" == "ffmpeg") ]]; then
bash ./ffmpeg/build.sh "$@"
else
- echo ERROR: unknown browser to build - "$1"
+ echo ERROR: unknown browser to build - "$CMD"
exit 1
fi
diff --git a/browser_patches/clean.sh b/browser_patches/clean.sh
index 4cba35f945..b6a2cfe1da 100755
--- a/browser_patches/clean.sh
+++ b/browser_patches/clean.sh
@@ -18,20 +18,22 @@ if [[ $# == 0 ]]; then
exit 1
fi
-if [[ ("$1" == "firefox") || ("$1" == "firefox/") || ("$1" == "ff") ]]; then
+CMD="$1"
+shift
+if [[ ("$CMD" == "firefox") || ("$CMD" == "firefox/") || ("$CMD" == "ff") ]]; then
bash ./firefox/clean.sh "$@"
-elif [[ ("$1" == "firefox-beta") || ("$1" == "ff-beta") ]]; then
+elif [[ ("$CMD" == "firefox-beta") || ("$CMD" == "ff-beta") ]]; then
bash ./firefox-beta/clean.sh "$@"
-elif [[ ("$1" == "webkit") || ("$1" == "webkit/") || ("$1" == "wk") ]]; then
+elif [[ ("$CMD" == "webkit") || ("$CMD" == "webkit/") || ("$CMD" == "wk") ]]; then
bash ./webkit/clean.sh "$@"
-elif [[ ("$1" == "chromium") || ("$1" == "chromium/") || ("$1" == "cr") ]]; then
+elif [[ ("$CMD" == "chromium") || ("$CMD" == "chromium/") || ("$CMD" == "cr") ]]; then
bash ./chromium/clean.sh "$@"
-elif [[ ("$1" == "winldd") ]]; then
+elif [[ ("$CMD" == "winldd") ]]; then
bash ./winldd/clean.sh "$@"
-elif [[ ("$1" == "ffmpeg") ]]; then
+elif [[ ("$CMD" == "ffmpeg") ]]; then
bash ./ffmpeg/clean.sh "$@"
else
- echo ERROR: unknown browser to build - "$1"
+ echo ERROR: unknown browser to build - "$CMD"
exit 1
fi