-
-
Save mattbasta/5514310 to your computer and use it in GitHub Desktop.
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/bash | |
# Which version should we fetch? | |
b2gremote="https://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/" | |
appname="B2G" | |
if [ "$1" == "aurora" ]; then | |
b2gremote="https://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-aurora/" | |
appname="B2GAurora" | |
fi | |
# find the right DMG | |
echo $b2gremote | |
ff=`curl -s $b2gremote | grep -oE "b2g-[^>]*?\.mac64\.dmg" | head -n1` | |
echo "fetching $ff" | |
fetch_url="$b2gremote$ff" | |
curl $fetch_url > $ff | |
# mount | |
vol=`hdiutil mount $ff | grep -oe "\/Volumes\/.*"` | |
echo "mounted at $vol" | |
# install | |
echo "copying file... ($vol/B2G.app)" | |
cp -R "$vol/B2G.app" /Applications/$appname.app | |
# clean up after ourselves. | |
echo "cleaning up..." | |
hdiutil unmount "$vol" | |
rm $ff | |
# success! | |
echo "B2G successfully installed at /Applications/$appname.app" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment