Created
January 9, 2017 04:35
-
-
Save dudelson/5b5c4ab005b65149d68ec5d45918450b to your computer and use it in GitHub Desktop.
The git pre-commit hook for my website. Responsible for building my blog archives and updating the "Last updated" info in the footer.
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
#!/usr/bin/sh | |
# this line is necessary to get the script to run in magit | |
PATH=$PATH:~/.gem/ruby/2.3.0/bin | |
echo "Running jekyll pre-build..." \ | |
&& bundle exec jekyll build \ | |
&& echo "Generating archives..." \ | |
&& ruby blog/archive/_generator.rb \ | |
&& git add blog/archive/dates blog/archive/tags \ | |
&& echo "Done!" \ | |
&& echo \ | |
&& echo "Updating site footer..." \ | |
&& sed -i -- "s.[[:digit:]]\{4\}/[[:digit:]]\{2\}/[[:digit:]]\{2\}.$(date +'%Y/%m/%d')." _includes/footer.html \ | |
&& echo "Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment