Skip to content

Instantly share code, notes, and snippets.

@potch
Created October 30, 2012 22:21
Show Gist options
  • Save potch/3983487 to your computer and use it in GitHub Desktop.
Save potch/3983487 to your computer and use it in GitHub Desktop.
On a Mac? use this script to update your B2G Desktop!
#!/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"
@potch
Copy link
Author

potch commented Nov 20, 2012

run ./getb2g.sh aurora to get the mozilla-aurora builds instead of mozilla-central.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment