Created
November 18, 2019 17:35
-
-
Save simonrenger/3243c1d0176ac2fed5aeb5479b8dddda to your computer and use it in GitHub Desktop.
Pull & Build a hugo repositry and move to destination
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 | |
# Author: Simon Renger <[email protected]> | |
# This script will pull and build your Hugo website from a git server and then build it and move to the correct location. | |
# Simple usage:$ sh pb_hugo.sh <reponame> <folder name> <move location> | |
# example: sh pb_hugo.sh https://gitserver.tld/user/my-blog.git my-blog /home/user/www/ | |
if [ ! -d $2 ] | |
then | |
echo "Clone repo and build" | |
git clone $1 $2 && cd $2 && hugo && mv public $3 | |
else | |
echo "pull and build hugo website and move to dest" | |
cd $2 && git pull && hugo && mv public $3 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment