Skip to content

Instantly share code, notes, and snippets.

@tomhodgins
Created August 6, 2011 09:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tomhodgins/1129215 to your computer and use it in GitHub Desktop.
Save tomhodgins/1129215 to your computer and use it in GitHub Desktop.
Update WebKit to latest nightly build for OS X
#! /bin/sh
echo "Welcome to WebKitten, the WebKit updater"
echo "This process may take a few minutes"
mkdir ~/.webkitten
cd ~/.webkitten
# This sets a variable named 'LATEST' that is the
# value of the latest webkit download for OS X
LATEST=`curl -s "http://nightly.webkit.org" | sed -n 's/.*http/http/'p | sed -n 's/dmg.*/dmg/'p | sed -n 1p`
echo "Downloading WebKit..."
curl -O $LATEST
echo "WebKit successfully downloaded!"
# This mounts the DMG, copies the file, and unmounts the DMG
hdid WebKit-SVN-r*.dmg
echo "Disk Image Mounted"
rm -R /Applications/Webkit.app
echo "Old WebKit removed, copying file..."
cp -R /Volumes/Webkit/WebKit.app /Applications/
umount /Volumes/WebKit
rm WebKit-SVN-r*.dmg
# This cleans up the temporary directory used to download the files
cd ../
rm -R ~/.webkitten
echo "All files cleaned up"
while true
do
echo "Would you like to run WebKit now, y or n?"
read CONFIRM
case $CONFIRM in
y|Y|yes|YES|Yes) break ;;
n|N|no|NO|No)
echo "Thanks for using Webkitten, enjoy your fresh WebKit"
exit
;;
*) echo "Please enter yes or no"
esac
done
echo "Launching today's freshest WebKit build"
open -a Webkit.app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment