export NVM_DIR="$HOME/.nvm" if [ -s "$NVM_DIR/nvm.sh" ]; then type nvm >/dev/null 2>&1 || . $NVM_DIR/nvm.sh nvm use $(< .nvmrc) || nvm install $(< .nvmrc) fi # for node installed via nvm NODE_VERSIONS="$NVM_DIR/versions/node" NODE_VERSION_PREFIX=v use node if [ "z$CHROME_PATH" = "z" ] && [ ! -d "$(pwd)/chrome/" ]; then echo "CHROME_PATH not set and no chrome/ directory found for testing." echo "Run the following command to install chrome:" echo "npx @puppeteer/browsers install chrome@stable" echo "and then set CHROME_PATH to path from the following command" echo "npx @puppeteer/browsers list" else export CHROME_PATH=$(npx @puppeteer/browsers list | head -n 1 | cut -d ' ' -f '3') fi