-
Notifications
You must be signed in to change notification settings - Fork 3
/
install_browser_drivers
executable file
·28 lines (23 loc) · 1.45 KB
/
install_browser_drivers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
[[ "${BASH_SOURCE[0]}" != "$0" ]] && { echo "ERROR: this script must be executed by Bash, neither source'd nor executed by a different shell"; return 1; }
set -e
set -u
PACKAGE_DIR=$(dirname "$(realpath -e "${BASH_SOURCE[0]}")")
if [[ -v BROWSER_DRIVER_INSTALLER_CHROME_VERSION && -v BROWSER_DRIVER_INSTALLER_CHROMEDRIVER_PATH ]]; then
node "${PACKAGE_DIR}"/index.js \
--browser-name Chrome \
--browser-version "$BROWSER_DRIVER_INSTALLER_CHROME_VERSION" \
--target-path "$BROWSER_DRIVER_INSTALLER_CHROMEDRIVER_PATH"
else
echo "One or both of the environment variables related to Chrome (BROWSER_DRIVER_INSTALLER_CHROME_VERSION are" \
"BROWSER_DRIVER_INSTALLER_CHROMEDRIVER_PATH) are not set, skipping the installation for Chrome"
fi
if [[ -v BROWSER_DRIVER_INSTALLER_FIREFOX_VERSION && -v BROWSER_DRIVER_INSTALLER_GECKODRIVER_PATH ]]; then
node "${PACKAGE_DIR}"/index.js \
--browser-name Firefox \
--browser-version "$BROWSER_DRIVER_INSTALLER_FIREFOX_VERSION" \
--target-path "$BROWSER_DRIVER_INSTALLER_GECKODRIVER_PATH"
else
echo "One or both of the environment variables related to Firefox (BROWSER_DRIVER_INSTALLER_FIREFOX_VERSION and" \
"BROWSER_DRIVER_INSTALLER_GECKODRIVER_PATH) are not set, skipping the installation for Firefox"
fi