shithub: hugo

Download patch

ref: 461b0e066f8b7a38f8e69f118e8c020e20b09a13
parent: 9f5a92078a3f388b52d597b5a59af5c933a112d2
parent: 5cb4e46cfa65bddae8ac5344540e3dd1e4c266b2
author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
date: Wed Jul 24 05:36:50 EDT 2019

Merge commit '5cb4e46cfa65bddae8ac5344540e3dd1e4c266b2'

--- a/docs/content/en/hosting-and-deployment/hosting-on-github.md
+++ b/docs/content/en/hosting-and-deployment/hosting-on-github.md
@@ -67,30 +67,31 @@
 The following are the contents of the `deploy.sh` script:
 
 ```
-#!/bin/bash
+#!/bin/sh
 
-echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"
+# If a command fails then the deploy stops
+set -e
 
+printf "\033[0;32mDeploying updates to GitHub...\033[0m\n"
+
 # Build the project.
 hugo # if using a theme, replace with `hugo -t <YOURTHEME>`
 
 # Go To Public folder
 cd public
+
 # Add changes to git.
 git add .
 
 # Commit changes.
-msg="rebuilding site `date`"
-if [ $# -eq 1 ]
-  then msg="$1"
+msg="rebuilding site $(date)"
+if [ -n "$*" ]; then
+	msg="$*"
 fi
 git commit -m "$msg"
 
 # Push source and build repos.
 git push origin master
-
-# Come Back up to the Project Root
-cd ..
 ```