Sharing the shell script I updated to keep my version current. I have an Indigo variable that holds my Chrome version number. When that changes, this shell script fires. I'm sure it can be improved but it works.
- Code: Select all
#!/bin/sh
# Downloads chromedriver based on your current chrome version, unzips, deletes zip file
# Get current chrome version
# Pass version number into curl call
CHROME_VERSION=$(/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version | sed 's/.*Chrome //' | tr -d '[:space:]')
ZIP_FILE_NAME=chromedriver-mac-x64.zip
CD_FILE_NAME=chromedriver
# Change the directory where we want to drop the file
cd /Library/Application\ Support/Perceptive\ Automation/Python3-includes
# delete the old chromedriver
rm $CD_FILE_NAME
# Insert CHROME_VERSION into download URL:
curl -o ./$ZIP_FILE_NAME "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROME_VERSION/mac-x64/$ZIP_FILE_NAME"
# Unzip. -o flag means overwrite
unzip -o $ZIP_FILE_NAME
# Move the chrome driver from the sub folder
mv -f /Library/Application\ Support/Perceptive\ Automation/Python3-includes/chromedriver-mac-x64/* /Library/Application\ Support/Perceptive\ Automation/Python3-includes/
# Delete sub folder
rmdir /Library/Application\ Support/Perceptive\ Automation/Python3-includes/chromedriver-mac-x64
# Delete the zip file
rm $ZIP_FILE_NAME
# Clean / remove quarantine for Apple in order to open it - Note: this is not longer needed
xattr -d com.apple.quarantine chromedriver