Created
August 17, 2011 21:18
-
-
Save tomhodgins/1152664 to your computer and use it in GitHub Desktop.
Update Firefox to latest nightly build for OS X
This file contains hidden or 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 | |
echo "Welcome to FireFetch, the Firefox updater" | |
echo "This process may take a few minutes" | |
mkdir ~/.firefetch | |
cd ~/.firefetch | |
# This sets a variable named 'LATEST' that is the | |
# value of the latest Firefox download for OS X | |
LATEST=`curl -s "http://nightly.mozilla.org" | sed -n 's/.*http/http/'p | sed -n 's/dmg.*/dmg/'p | sed -n 1p` | |
echo "Downloading Firefox Nightly..." | |
curl -O $LATEST | |
echo "Firefox Nightly successfully downloaded!" | |
# This mounts the DMG, copies the file, and unmounts the DMG | |
hdid *.dmg | |
echo "Disk Image Mounted" | |
rm -R /Applications/Nightly.app | |
echo "Old Firefox Nightly removed, copying file..." | |
cp -R /Volumes/Nightly/Nightly.app /Applications/ | |
umount /Volumes/Nightly | |
rm *.dmg | |
# This cleans up the temporary directory used to download the files | |
cd ../ | |
rm -R ~/.FireFetch | |
echo "All files cleaned up" | |
while true | |
do | |
echo "Would you like to run Firefox now, y or n?" | |
read CONFIRM | |
case $CONFIRM in | |
y|Y|yes|YES|Yes) break ;; | |
n|N|no|NO|No) | |
echo "Thanks for using FireFetch, enjoy your fresh Firefox" | |
exit | |
;; | |
*) echo "Please enter yes or no" | |
esac | |
done | |
echo "Launching today's freshest Firefox build" | |
open -a Nightly.app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment