From 94dbeaaab36e3f6496da0bf10aac727ac533c4fe Mon Sep 17 00:00:00 2001 From: Nils <> Date: Sun, 5 Apr 2020 01:53:33 +0200 Subject: [PATCH] Auto-deploy when on a host --- generate.bash | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/generate.bash b/generate.bash index bb59009..c5ef93c 100755 --- a/generate.bash +++ b/generate.bash @@ -2,11 +2,6 @@ set -euf -o pipefail #exit on fail, unset variables, file-globs/expansion and piping problems -function finish { - read -n 1 -s -r -p "Press any key to continue" -} -trap finish EXIT - ROOTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" cd "$ROOTPATH" echo Running from "$ROOTPATH" @@ -92,3 +87,11 @@ do done #Home-Content cat "modules/10head" "temp/index_menu" "modules/20aftermenu" "directcontent/index" "modules/90foot" > "out/index.html" + +#Check if we have an HTML dir, then deploy +cd "$ROOTPATH" #reset for next step +if [ -d "../html" ]; then + echo "It looks like we are on a host. Deploying website" + cp -a out/. ../html #copy all, including hidden. This will not replace the html symlink +fi +