Last active
February 6, 2021 16:51
-
-
Save chaosbunker/8f1327dda291169458a40fcb917710d1 to your computer and use it in GitHub Desktop.
Get latest Chromium build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Chromium update script | |
# | |
# Get latest build from | |
# https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html | |
# Mac | Linux | ... | |
OS=Mac | |
DL_URL=https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/${OS} | |
LATEST=$(curl "https://www.googleapis.com/storage/v1/b/chromium-browser-snapshots/o/${OS}%2FLAST_CHANGE" | jq '.metadata."cr-commit-position-number"' | sed -e s/\"//g) | |
INSTALL_DIR=/Applications | |
TMP_DIR="/tmp/update-chrome-$RANDOM" | |
TMP_File=chromium.zip | |
( | |
mkdir $TMP_DIR ; cd $TMP_DIR | |
echo Download... | |
curl ${DL_URL}%2F${LATEST}%2Fchrome-${OS,,}.zip\?alt\=media -o ${TMP_File} | |
if [ $? -ne 0 ] ; then | |
echo Cannot update. | |
exit 0 | |
fi | |
echo Unzipping... | |
unzip -qq ${TMP_File} | |
echo Copying... | |
rm -rf "${INSTALL_DIR}/Chromium.app" | |
mv chrome-${OS,,}/Chromium.app "$INSTALL_DIR" | |
# make Chromium stop asking to allow incoming network connections | |
codesign -s "myCodeSigningCert" --force /Applications/Chromium.app --deep | |
) | |
rm -rf $TMP_DIR | |
echo Done... | |
rm -rf $TMP_DIR | |
echo Done... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment