Created
August 31, 2020 10:52
-
-
Save mand2/277f0c526d51e6a3ca5b9270575360fa to your computer and use it in GitHub Desktop.
Auto commit shell script for Hugo template users.
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/bash | |
msg_public_file={{ directory of the `public` commit message file}} | |
msg_blog_file={{ directory of the `blog` commit message file }} | |
echo -e "\033[0;32mDeploying updates to GitHub...\033[0m" | |
# Build the project. | |
hugo | |
##### public repo Commit & Push ##### | |
# Go To Public folder | |
cd public | |
# Add `changes` to git. | |
git add . | |
# Commit `changes` with custom commit messages. | |
msg_public=`cat $msg_public_file` | |
git commit -m "$msg_public" | |
# Push source and build repos. | |
git push | |
# Come Back up to the Project Root | |
cd .. | |
##### blog repo Commit & Push ##### | |
# public repo에 한 것과 동일. | |
git add . | |
msg_blog=`cat $msg_blog_file` | |
git commit -m "$msg_blog" | |
git push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment