Last active
February 27, 2017 09:01
-
-
Save annedorko/483f866c150b8653dab4659f00e904a0 to your computer and use it in GitHub Desktop.
post-receive hook for deploying Twist themes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GIT_REPO=/PATH/TO/SITE/PARENT/deploy.git | |
TMP_GIT_CLONE=/PATH/TO/SITE/PARENT/tmp | |
PUBLIC_WWW=/PATH/TO/SITE/PARENT/public_html/wp-content/themes/THEME/ | |
# Clone repo into a temporary folder | |
git clone $GIT_REPO $TMP_GIT_CLONE | |
# Generate style.css | |
sass $TMP_GIT_CLONE/_scss/style.scss:$TMP_GIT_CLONE/style.css --style compressed | |
# Remove extraneous files, delete current public theme | |
rm -Rf $TMP_GIT_CLONE/_scss/ $TMP_GIT_CLONE/style.css.map $PUBLIC_WWW | |
# Recreate directory for theme | |
mkdir -p $PUBLIC_WWW | |
# Move updated files to the theme folder | |
mv $TMP_GIT_CLONE/* $PUBLIC_WWW | |
# Delete temporary files | |
rm -Rf $TMP_GIT_CLONE | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment