From a137809167b6758bee9ee1a82bd5436efbf07933 Mon Sep 17 00:00:00 2001 From: Frieder Griesshammer Date: Sat, 14 May 2022 18:18:58 +0200 Subject: [PATCH] Enable option to use some custom path to hugo - Turns out, it works on the server, but not fom the crontab - The GOPATH environment variable does indeed suck - It is not required for launching (some precompiled) hugo --- auto_build.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/auto_build.sh b/auto_build.sh index 584f000..61e4a1c 100755 --- a/auto_build.sh +++ b/auto_build.sh @@ -13,7 +13,7 @@ CLONE_DIR=${CLONE_DIR="$HOME/homepage"} # local checkout path ORIGIN=${ORIGIN="origin"} BRANCH=${BRANCH="main"} -GOPATH=${GOPATH="$HOME/go/bin"} +HUGO_CMD=${HUGO_CMD="hugo"} WWWDIR=${WWWDIR="/var/www/www"} # bugs ahead @@ -92,13 +92,12 @@ latest_remote_sha () { build_page() { TMPDIR=$(mktemp -d -t hugo_build_XXXXX) - PATH=$PATH:$GOPATH \ - hugo \ - --quiet \ - --enableGitInfo \ - --source "$CLONE_DIR" \ - --destination "$TMPDIR" \ - || exit 1 + $HUGO_CMD \ + --quiet \ + --enableGitInfo \ + --source "$CLONE_DIR" \ + --destination "$TMPDIR" \ + || exit 1 rm -rf "${WWWDIR:?}"/* cp -r "$TMPDIR"/. "$WWWDIR"