Last active
December 18, 2015 11:59
-
-
Save wzpan/5779211 to your computer and use it in GitHub Desktop.
Shell - help me compile ruhoh and ask me to push to my repositories
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
#!/bin/zsh | |
cd $RUHOH | |
rm -r compiled | |
bundle exec ruhoh compile | |
cd - | |
echo -n "Copy the compiled result to your site repo?[y/n]" | |
read copy_yn | |
if [ "$copy_yn" = "y" ]; then | |
cd $PUBLISH | |
rm -r * | |
cd - | |
cp -av $RUHOH/compiled/* $PUBLISH/ | |
echo -n "Update your site repo?[y/n]" | |
read update_site_yn | |
case "$update_site_yn" in | |
y ) | |
cd $PUBLISH | |
git add --all | |
read -p "Please enter commit message: " commit_message | |
git commit -m $commit_message | |
git push | |
cd - | |
echo "Congrats! The site repo has been updated" | |
cd $RUHOH | |
git add --all | |
git commit -m $commit_message | |
git push | |
cd - | |
cd $RUHOH/wiki | |
git add --all | |
git commit -m $commit_message | |
git push | |
cd - | |
echo "Congrats! The blog repo has been updated" | |
;; | |
n ) | |
echo "Don't copy them this time." | |
;; | |
*) | |
echo "Please enter y or n." | |
exit 1 | |
;; | |
esac | |
elif [ "$copy_yn" = "n" ]; then | |
echo "Don't copy them this time." | |
else | |
echo "Please enter y or n." | |
exit 1 | |
fi | |
echo "All done!" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment