1
0
mirror of synced 2026-08-04 22:46:55 +00:00

feat(driver): extract driver into temp folder when running playwright (#74)

This commit is contained in:
Yury Semikhatsky
2020-11-16 22:58:59 -08:00
committed by GitHub
parent eeb8bd16c9
commit 6676cdd5b2
7 changed files with 131 additions and 43 deletions
+44
View File
@@ -0,0 +1,44 @@
#!/bin/bash
set -e
set +x
FILE_PREFIX=playwright-cli-0.160.0-next.1604373941495
trap "cd $(pwd -P)" EXIT
cd "$(dirname $0)"
cd ../playwright/src/main/resources
if [[ -d driver ]]; then
echo "$(pwd)/driver already exists, delete it first"
exit 1;
fi
mkdir driver
cd driver
echo "Created directory: $(pwd)"
FILE_NAME="unknown"
case $(uname) in
Darwin)
FILE_NAME=${FILE_PREFIX}-mac.zip
echo "Downloading driver for macOS"
;;
Linux)
FILE_NAME=${FILE_PREFIX}-linux.zip
echo "Downloading driver for Linux"
;;
MINGW*)
FILE_NAME=${FILE_PREFIX}-win32_x64.zip
echo "Downloading driver for Windows"
;;
*)
echo "Unknown platform '$(uname)'"
exit 1;
;;
esac
curl -O https://playwright.azureedge.net/builds/cli/next/${FILE_NAME}
unzip ${FILE_NAME} -d .
rm $FILE_NAME
./playwright-cli install