Skip to content

Instantly share code, notes, and snippets.

@joebuschmann
Created September 26, 2014 16:48
Show Gist options
  • Save joebuschmann/0598171f19d893c66a24 to your computer and use it in GitHub Desktop.
Save joebuschmann/0598171f19d893c66a24 to your computer and use it in GitHub Desktop.
Script to zip up a modified Casper theme for uploading to a Ghost blog
#!/bin/sh
# Execute this script from the content/themes directory.
# This script copies the Casper theme in the "Casper" directory
# to a new directory with the new theme name. Then it creates
# a .zip file with the new directory's contents.
# New theme name. Update if you aren't Joe Buschmann :-)
THEME_NAME="Casper-JoeBuschmann"
readonly THEME_NAME
# Clean up old files
rm -rf $THEME_NAME
rm -f $THEME_NAME.zip
# Copy the modified Casper theme to a folder with the new theme name
cp -r casper $THEME_NAME
cd $THEME_NAME
rm .gitignore
rm -rf .git
# Update the theme name in the package config.
sed -i -e "s/Casper/$THEME_NAME/g" package.json
# Create a zip file for uploading
cd ..
zip -r $THEME_NAME.zip $THEME_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment