#!/bin/bash [[ $# = 0 ]] && echo "ERROR" && exit 1 ARGS="" if [ -f $GITBUILDDIR/config/hostname ]; then base_url="https://$(cat $GITBUILDDIR/config/hostname)/~$USER/$1" echo $base_url ARGS="$ARGS -u $base_url" fi zola build $ARGS if [[ $? != 0 ]]; then echo "Building site $1 failed." exit 2 fi rm -R ~/public_html/$1 cp -R public ~/public_html/$1 rm -R public