diff --git a/README.md b/README.md index 53f614e..afa788c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,12 @@ # chromium-latest-linux -Scripts to download and run the latest Linux build of Chromium. +Scripts to download and run the latest **Mac or Linux** build of Chromium. + +## Usage +```console +./update.sh # Update linux version +./update.sh mac # Update mac version + +./update-and-run.sh # Update and run latest linux version +./update-and-run.sh mac # Update and run latest mac version +./update-and-run.sh linux # You can also specify linux for clarity +``` diff --git a/update-and-run.sh b/update-and-run.sh index 93673ed..ad09ac8 100755 --- a/update-and-run.sh +++ b/update-and-run.sh @@ -1,3 +1,3 @@ #! /bin/bash cd $(dirname $0) -./update.sh && ./run.sh +./update.sh $1 && ./run.sh diff --git a/update.sh b/update.sh index 6730185..508bc90 100755 --- a/update.sh +++ b/update.sh @@ -2,7 +2,18 @@ cd $(dirname $0) -LASTCHANGE_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2FLAST_CHANGE?alt=media" +case "$1" in + mac) + PLATFORM="mac" + REVISION_PREFIX="Mac" + ;; + linux | *) + PLATFORM="linux" + REVISION_PREFIX="Linux_x64" + ;; +esac + +LASTCHANGE_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/${REVISION_PREFIX}%2FLAST_CHANGE?alt=media" REVISION=$(curl -s -S $LASTCHANGE_URL) @@ -13,9 +24,9 @@ if [ -d $REVISION ] ; then exit fi -ZIP_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F$REVISION%2Fchrome-linux.zip?alt=media" +ZIP_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/${REVISION_PREFIX}%2F${REVISION}%2Fchrome-${PLATFORM}.zip?alt=media" -ZIP_FILE="${REVISION}-chrome-linux.zip" +ZIP_FILE="${REVISION}-chrome-${PLATFORM}.zip" echo "fetching $ZIP_URL" @@ -27,5 +38,5 @@ echo "unzipping.." unzip $ZIP_FILE popd rm -f ./latest -ln -s $REVISION/chrome-linux/ ./latest +ln -s $REVISION/chrome-$PLATFORM/ ./latest