fix: run creates the files directory if it doesn't exist. .example files can be run

master
Kebler Network System Administrator 2022-05-01 13:34:53 -07:00
parent 42dedabba9
commit 92cb1f48c5
1 changed files with 3 additions and 1 deletions

4
run
View File

@ -3,7 +3,7 @@
RDIR=$(cd $(dirname $(readlink -f "$0")) >/dev/null 2>&1 ; pwd -P)
# source any environment for particular site
shopt -s extglob
ENV_FILE=$(ls $RDIR/sites/${1}* 2> /dev/null | grep -v '.off$\|.example$\|.tmpl$\|.template$')
ENV_FILE=$(ls $RDIR/sites/${1}* 2> /dev/null | grep -v '.off$\|.tmpl$\|.template$')
if [[ $ENV_FILE ]]; then
source $ENV_FILE
@ -20,6 +20,8 @@ HUGO=${HUGO:-$(command -v hugo)}
PORT=${PORT:-8096}
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
mkdir -p $DATA_DIR
# start hugo in the data directory (needed for git module)
cd $DATA_DIR
ls -la
CMD="$HUGO server