Browse Source

Auto-deploy when on a host

master
Nils 5 years ago
parent
commit
94dbeaaab3
  1. 13
      generate.bash

13
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

Loading…
Cancel
Save