Skip to content

Instantly share code, notes, and snippets.

@nhirata
Created January 30, 2013 22:15
Show Gist options
  • Save nhirata/4677679 to your computer and use it in GitHub Desktop.
Save nhirata/4677679 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -o errexit
echo "Plug in your device"
adb wait-for-device
echo "Found device"
#dir=$(mktemp -d -t revision)
dir=$(mktemp -d -t revision.XXXXXX)
if [!dir]; then
mkdir dir
fi
cd $dir
adb pull /system/b2g/omni.ja &>/dev/null || echo "Error pulling gecko"
adb pull /system/b2g/webapps/settings.gaiamobile.org/application.zip &> /dev/null || echo "Error pulling gaia file"
adb pull /system/b2g/application.ini &> /dev/null || echo "Error pulling application.ini"
unzip omni.ja chrome/toolkit/content/global/buildconfig.html > /dev/null
unzip application.zip resources/gaia_commit.txt > /dev/null
echo 'Gecko ' $(grep "Built from" ./chrome/toolkit/content/global/buildconfig.html | sed "s,.*<a href=\",,g ; s,\">.*,,g")
echo 'Gaia ' $(head -n 1 ./resources/gaia_commit.txt)
for i in BuildID Version ; do
echo $i $(grep "^ *$i" application.ini | sed "s,.*=,,g")
done
rm -rf $dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment