diff --git a/scripts/download_driver_for_all_platforms.sh b/scripts/download_driver_for_all_platforms.sh index 92237702..9011908d 100755 --- a/scripts/download_driver_for_all_platforms.sh +++ b/scripts/download_driver_for_all_platforms.sh @@ -6,12 +6,26 @@ set +x trap "cd $(pwd -P)" EXIT cd "$(dirname $0)" +if [[ ($1 == '-h') || ($1 == '--help') ]]; then + echo "" + echo "This script for downloading playwright-cli binaries for all platforms." + echo "The downloaded files will be put into directory 'driver-bundle/src/main/resources/driver'." + echo "" + echo "Usage: scripts/download_driver_for_all_platforms.sh [option]" + echo "" + echo "Options:" + echo " -h, --help display help information" + echo " -f, --force delete existing drivers and download them again" + echo "" + exit 0 +fi + CLI_VERSION=$(head -1 ./CLI_VERSION) FILE_PREFIX=playwright-cli-$CLI_VERSION cd ../driver-bundle/src/main/resources -if [[ $1 == '-f' ]]; then +if [[ ($1 == '-f') || ($1 == '--force') ]]; then echo "Deleting existing drivers from $(pwd)" rm -rf driver fi @@ -43,3 +57,7 @@ do cd - done +echo "" +echo "All drivers have been downloaded successfully, use '-f' or '--force' option to delete and download them again if you want." +echo "For more details, you can use '-h' or '--help' option, or read the CONTRIBUTING.md for reference." +echo ""