Skip to content

Instantly share code, notes, and snippets.

@dandean
Created April 3, 2010 19:54
Show Gist options
  • Select an option

  • Save dandean/354806 to your computer and use it in GitHub Desktop.

Select an option

Save dandean/354806 to your computer and use it in GitHub Desktop.
#!/bin/bash
show=
xport=
upload=
newfiles=0
while getopts 'oeu' OPTION
do
case $OPTION in
o) show=1
;;
e) xport=1
;;
u) upload=1
;;
esac
done
if [ "$show" ]
then
echo "Opening the Fancy trunk directory."
open ~/Sites/fancy/trunk
echo "Opening the Fancy theme directory in TextMate."
mate ~/Sites/fancy/trunk/themes/fancy
fi
echo "Running the Fancy build script."
cd ~/Sites/fancy/trunk/themes/fancy/lib
./build
if [ "$xport" ]
then
echo "Crunkin' it up!"
cd ~/Sites/fancy/trunk/themes
echo "Removing old export files!"
rm ~/Sites/fancy/trunk/exports/fancy.zip
rm -rf ~/Sites/fancy/trunk/exports/fancy
let newfile_count=`svn status | grep "^\?" -c`
if [ $newfile_count -gt 0 ]
then
echo "Adding new files!"
svn status
svn add ~/Sites/fancy/trunk/themes/fancy/* --force
fi
echo "Exporting Theme from SVN!"
svn export ./fancy ~/Sites/fancy/trunk/exports/fancy
cd ~/Sites/fancy/trunk/exports/
echo "Compressing theme!"
zip -r fancy fancy
open .
if [ "$upload" ]
then
open http://fancyjewels.myshopify.com/admin/assets
fi
fi
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment