Created
February 14, 2010 21:07
-
-
Save robhanlon22/304263 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/sh | |
pushd /tmp | |
SCRIPT_TEXT=" | |
on run argv\n | |
if appIsRunning(\"Chromium\") then\n | |
set userCanceled to false\n | |
tell application \"Chromium\"\n | |
try\n | |
display dialog \"Downloaded newest Chromium nightly, need to relaunch to use new version.\" with icon stop\n | |
on error number -128\n | |
set userCanceled to true\n | |
end try\n | |
if not userCanceled then\n | |
quit\n | |
delay 2\n | |
activate application \"Chromium\"\n | |
end if\n | |
end tell\n | |
end if\n | |
end run\n | |
on appIsRunning(appName)\n | |
tell application \"System Events\" to (name of processes) contains appName\n | |
end appIsRunning" | |
SCRIPT_NM="dialog.scpt" | |
echo -e $SCRIPT_TEXT > $SCRIPT_NM | |
APPS="/Applications" | |
C_APP_NM='Chromium.app' | |
C_DL_DIR='chrome-mac' | |
C_INSTALL="$APPS/$C_APP_NM" | |
C_DL_FL="$C_DL_DIR/$C_APP_NM" | |
BASE_URL='http://build.chromium.org/buildbot/snapshots/chromium-rel-mac' | |
LATEST_URL="$BASE_URL/LATEST" | |
ZIP_FILE='chrome-mac.zip' | |
latest=`curl "$LATEST_URL"` | |
if [[ $latest ]] | |
then | |
wget "$BASE_URL/$latest/$ZIP_FILE" && | |
unzip "$ZIP_FILE" && | |
rm -rf "$C_INSTALL" && | |
mv "$C_DL_FL" "$APPS" && | |
osascript $SCRIPT_NM | |
fi | |
rm -rf $C_DL_DIR $ZIP_FILE $SCRIPT_NM | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment