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
pull/42/head
sixtus 2022-05-14 18:18:58 +02:00
parent 246eaf7ca9
commit a137809167
1 changed files with 7 additions and 8 deletions

View File

@ -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"