From f346ec63431744111e8c7ffa2bf99c561609a081 Mon Sep 17 00:00:00 2001 From: Pietu Date: Thu, 31 Jan 2019 17:14:39 +0200 Subject: [PATCH 1/4] Add platform as argument --- update.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/update.sh b/update.sh index 6730185..9a996f4 100755 --- a/update.sh +++ b/update.sh @@ -2,7 +2,22 @@ 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 + linux) + PLATFORM="linux" + REVISION_PREFIX="Linux_x64" + ;; + mac) + PLATFORM="mac" + REVISION_PREFIX="Mac" + ;; + *) + echo "Please specify platform (mac or linux) as argument."; + exit 1 + ;; +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 +28,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 +42,5 @@ echo "unzipping.." unzip $ZIP_FILE popd rm -f ./latest -ln -s $REVISION/chrome-linux/ ./latest +ln -s $REVISION/chrome-$PLATFORM/ ./latest From 658ffc819f9738973aab16eca334ea14e0a95ebd Mon Sep 17 00:00:00 2001 From: Pietu Date: Thu, 31 Jan 2019 17:14:53 +0200 Subject: [PATCH 2/4] Pass platform argument to update.sh --- update-and-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From e836ee89fdbd1435592f820fc67b5514cbf8c5d3 Mon Sep 17 00:00:00 2001 From: Pietu Date: Thu, 31 Jan 2019 17:21:52 +0200 Subject: [PATCH 3/4] Set linux as default platform --- update.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/update.sh b/update.sh index 9a996f4..508bc90 100755 --- a/update.sh +++ b/update.sh @@ -3,17 +3,13 @@ cd $(dirname $0) case "$1" in - linux) - PLATFORM="linux" - REVISION_PREFIX="Linux_x64" - ;; mac) PLATFORM="mac" REVISION_PREFIX="Mac" ;; - *) - echo "Please specify platform (mac or linux) as argument."; - exit 1 + linux | *) + PLATFORM="linux" + REVISION_PREFIX="Linux_x64" ;; esac From 6eb5bcb061bc38ce960d06cd7db8d277d430abfe Mon Sep 17 00:00:00 2001 From: Pietu Date: Thu, 31 Jan 2019 17:14:59 +0200 Subject: [PATCH 4/4] Document usage --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 +```