Skip to content

Instantly share code, notes, and snippets.

@SkaTeMasTer
Last active February 12, 2018 00:14
Show Gist options
  • Save SkaTeMasTer/eb87e48f1f062e210f09a6d8c1d99d31 to your computer and use it in GitHub Desktop.
Save SkaTeMasTer/eb87e48f1f062e210f09a6d8c1d99d31 to your computer and use it in GitHub Desktop.
Need the bleeding edge of Web Btowser software?Get latest build of Chromium. Updated for 2018. They recently changed the folder structure. Add this to your cron to get the up-to-the-minute developer build.
#!/bin/sh
# Get current build for Chromium on Mac.
#
# @version 2009-05-22
# @author XXXX
# @todo Nothing yet
echo
" .·´`·.
.·´ .·´··.
.·´ .·´ .·´`·.
.·´ .·´ .·´ `·.
.·´ `·..·´ `·.
.·´ .·´`·. `·. .·´`·.`·.
.·´ .·´ `·. `·. .·´ .·´ .·´·..
.·´·:· .·´ `·. `·. `·.·´ .·´ .·´ `·.
`·..·´ `·. `·..·´ .·´ .·´
`·. `·. `·´ .·´
`·. `·. .·´
`·. .·´ .·´
`·. .·´ .·´
`·. .·´ .·´
`·.·´ ·:· .·´
`·..·´";
# setup ------------------------------------------------------------------------
tempDir="/tmp/`whoami`/chrome-nightly/";
baseURL="http://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac";
baseName="chrome-mac";
baseExt="zip";
appName="Chromium.app";
appDir="/Applications";
version=~/.CURRENT_CHROME;
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
function checkForErrors {
if [ "$?" != "0" ]; then
echo "Unkown error (see above for help)!";
exit 3;
fi
}
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
echo "Setup...";
mkdir -p "$tempDir";
cd "$tempDir";
checkForErrors;
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
echo "Checking current version...";
touch $version
currentVersion=`cat $version`;
latestVersion=`curl -s $baseURL/LATEST_CHANGE`;
checkForErrors;
echo " * your/latest build: $currentVersion / $latestVersion";
if [ "$currentVersion" == "$latestVersion" ]; then
echo " * build $currentVersion is the latest one.";
exit 1;
fi
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
echo "Downloading and unpacking...";
chromePID=`ps wwaux|grep -v grep|grep "$appName"|awk '{print $2}'`;
if [ "$chromePID" != "" ];then
echo " * chromium is running. Please stop it first.";
exit 2;
fi
#curl -o $baseName.$baseExt "$baseURL/$latestVersion/$baseName.$baseExt";
curl -L "$baseURL/$latestVersion/$baseName.$baseExt" -o $baseName.$baseExt;
unzip -qo $baseName.$baseExt;
checkForErrors;
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
echo "Installing...";
cp -r $baseName/$appName $appDir
checkForErrors;
echo $latestVersion > $version;
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
echo "Done. You're now running build $latestVersion";
# ------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment