Last active
November 7, 2016 14:40
-
-
Save dueyfinster/67c306c83687fd6c21e92ed837839730 to your computer and use it in GitHub Desktop.
Builds hugo static website on NearlyFreeSpeech.NET
This file contains hidden or 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 | |
| # A Script to do a hugo build if any future posts exist | |
| #set -x | |
| cd $HOME/repos/ngrogan.com | |
| LOCAL=$(git rev-parse @) | |
| REMOTE=$(git rev-parse origin) | |
| if [ $LOCAL = $REMOTE ]; then | |
| : | |
| else | |
| git pull | |
| fi | |
| grep -o "[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}" -R content | grep -o "[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}" | sed -e 's/\-//g' | ( while read line; do | |
| cond=$(date +"%Y%m%d") # = 20130715 | |
| if [ $line -ge $cond ]; #put the loop where you need it | |
| then | |
| NEEDS_UPDATE=true | |
| fi | |
| done | |
| if [ "$NEEDS_UPDATE" = true ]; then | |
| ~/bin/hugo -d $DOCUMENT_ROOT | |
| fi ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment