remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/apps/remix-ide-e2e/install-webdriver.sh

43 lines
1.2 KiB

7 months ago
#!/bin/bash
# Determine the OS platform
OS="$(uname)"
if [ "$OS" == "Darwin" ]; then
# macOS systems
if [ -e "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" ]; then
version=$("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --version)
echo "Google Chrome version on macOS: $version"
else
echo "Google Chrome is not installed on your macOS."
fi
elif [ "$OS" == "Linux" ]; then
# Linux systems
if command -v google-chrome >/dev/null; then
version=$(google-chrome --version)
echo "Google Chrome version on Linux: $version"
else
echo "Google Chrome is not installed on your Linux."
fi
else
echo "Unsupported OS."
fi
MAJORVERSION=$(echo "$version" | grep -Eo '[0-9]+\.' | head -1 | cut -d'.' -f1)
echo "CHROME DRIVER INSTALL $MAJORVERSION"
7 months ago
# Specify the directory to check
directory="./tmp/webdrivers"
# Check if the directory exists
if [ -d "$directory" ]; then
echo "Directory exists: $directory"
else
echo "Directory does not exist. Creating directory: $directory"
mkdir -p "$directory"
fi
yarn init -y --cwd "$directory" || exit 1
yarn add -D chromedriver@$MAJORVERSION geckodriver --cwd "$directory" || exit 1