Merge pull request 'Enable option to use some custom path to hugo' (#42) from auto_build_again into main

Reviewed-on: #42
This commit is contained in:
sixtus 2022-05-14 18:24:34 +02:00
commit 2e1666dbf1
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"