Skip to content

Instantly share code, notes, and snippets.

@a-r-d
Last active August 29, 2015 14:07
Show Gist options
  • Save a-r-d/f55f5869ee55166b7faa to your computer and use it in GitHub Desktop.
Save a-r-d/f55f5869ee55166b7faa to your computer and use it in GitHub Desktop.
Bash script for deploying roots themes. Packages theme file into a zip, omits .git and node_modules.
#!/bin/bash
#
# This is a simple deploy script to create a .zip file of your theme
# The first argument passed becomes the .zip filename.
echo "Building site for packaging..."
grunt build
echo "Begin zipping..."
FILE="roots-deploy-theme.zip"
if [ ! -z "$1" ]
then
FILE=$1
else
echo "No argument given, using default name: $FILE"
fi
if [ -r "$FILE" ]
then
echo "Cleaning up last deploy file..."
rm "$FILE"
fi
echo "Zipping theme contents into file: $FILE"
zip -r "$FILE" . -x node_modules\* *.zip deploy-roots.sh .git\*
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment