Skip to content

Instantly share code, notes, and snippets.

@oconnore
Created October 23, 2013 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oconnore/7120619 to your computer and use it in GitHub Desktop.
Save oconnore/7120619 to your computer and use it in GitHub Desktop.
Extract a gaia build for debugging : ./get-build.sh <system> [<cat-path>] ... for example: ./get-build.sh clock js/startup.js
#!/bin/sh
set -e
rm -r extracted
mkdir -p extracted
FOUND=`find profile/webapps/ -name "$1".gaiamobile.org | wc -l`
if [ "$FOUND" -gt 0 ]; then
APP="$1"
TARGET="profile/webapps/$1.gaiamobile.org/"
else
APP=`echo $1 | sed 's/^\([A-Za-z0-9]\+\)\..*$/\1/g'`
TARGET="profile/webapps/$1/"
fi
cp $TARGET/application.zip extracted/application.zip
cd extracted
unzip application.zip >/dev/null 2>&1
if [ -n "$2" -a -z "$3" ]; then
# no line number printed
cat "$2"
elif [ -n "$2" -a -n "$3" ]; then
# attempt to match lines
echo hi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment