Squashed 'docs/' changes from 540aeddc7..41aae7abb - hugo - [fork] hugo port for 9front
(HTM) git clone git@git.drkhsh.at/hugo.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
(DIR) commit 5cb4e46cfa65bddae8ac5344540e3dd1e4c266b2
(DIR) parent 35febb2e2a3780c3338a2665fddea7dda28a17f4
(HTM) Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date: Wed, 24 Jul 2019 09:36:50 +0200
Squashed 'docs/' changes from 540aeddc7..41aae7abb
41aae7abb Better deploy script example
git-subtree-dir: docs
git-subtree-split: 41aae7abb37d43db3a38e09f2ef674cce2c98ce9
Diffstat:
M content/en/hosting-and-deployment/… | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
---
(DIR) diff --git a/content/en/hosting-and-deployment/hosting-on-github.md b/content/en/hosting-and-deployment/hosting-on-github.md
@@ -67,30 +67,31 @@ You're almost done. In order to automate next steps create a `deploy.sh` script.
The following are the contents of the `deploy.sh` script:
```
-#!/bin/bash
+#!/bin/sh
+
+# If a command fails then the deploy stops
+set -e
-echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"
+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 ..
```