From c56f3caf497246074b234ad2e699329987356579 Mon Sep 17 00:00:00 2001 From: David Kebler Date: Sun, 17 Jan 2021 16:43:24 -0800 Subject: [PATCH] modify run to accept a subdirectory, so can be compatible with editor files in same project directory --- run | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/run b/run index e9262de..98f4971 100755 --- a/run +++ b/run @@ -15,15 +15,16 @@ else echo warning no environoment file set for $1 in $RDIR/sites fi DATA_DIR=${DATA_DIR:-${HOME}/.local/hugo} +DATA_DIR=${DATA_DIR}/${1}$([[ $DATA_SUB_DIR ]] && echo "/$DATA_SUB_DIR") HUGO=${HUGO:-$(command -v hugo)} PORT=${PORT:-8096} -echo site files in $DATA_DIR/$1 listening on port $PORT +echo site files in $DATA_DIR listening on port $PORT # [[ $(netstat -tulpn | grep LISTEN | grep 0.0.0.0:$PORT) ]] && echo tcp port $PORT is busy can not start hugo server && exit CMD="$HUGO server $([[ $BASE_URL = "https://"* ]] && echo " --liveReloadPort 443") --bind 0.0.0.0 --themesDir $RDIR/themes ---source $DATA_DIR/$1 +--source $DATA_DIR --port $PORT --appendPort=$([[ $REVERSE_PROXY = true ]] && echo false || echo true) --baseURL ${BASE_URL:-localhost}