Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add platform option to enable mac use #10

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
```
2 changes: 1 addition & 1 deletion update-and-run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#! /bin/bash
cd $(dirname $0)
./update.sh && ./run.sh
./update.sh $1 && ./run.sh
19 changes: 15 additions & 4 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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"

Expand All @@ -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