From 46087a2503032443d7f0613e5aeb2a5195c27850 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 8 Jun 2024 10:05:30 +0100 Subject: Fix: misc improvements --- bin/archive | 11 ++++++----- bin/assemble | 19 ++++++++++--------- bin/provision-host | 8 ++++---- 3 files changed, 20 insertions(+), 18 deletions(-) (limited to 'bin') diff --git a/bin/archive b/bin/archive index 584ea13..8949268 100755 --- a/bin/archive +++ b/bin/archive @@ -9,14 +9,15 @@ DIRNAME="`dirname $0`" BASEDIR="$DIRNAME/.." #ARCHIVE="$BASEDIR/archive" ARCHIVE="archive" +ASSETS="build" REVISION="`git describe --tags 2> /dev/null || git log -1 --format=oneline | cut -d ' ' -f 1`" # Determine the revision file -if [ -e "public/revision" ]; then - #REVFILE="$BASEDIR/public/revision" - REVFILE="public/revision" +if [ -e "$ASSETS/revision" ]; then + #REVFILE="$BASEDIR/$ASSETS/revision" + REVFILE="$ASSETS/revision" else - REVFILE="public/book/revision" + REVFILE="$ASSETS/book/revision" fi # Make sure the archive folder exist @@ -41,7 +42,7 @@ if git tag | grep -q "^${OLD_REVISION}"; then # Check if archive does not exists if [ ! -d "$ARCHIVE/$OLD_REVISION" ]; then echo "# $BASENAME: archiving $OLD_REVISION..." - cp -alf compiled $ARCHIVE/$OLD_REVISION + cp -alf $ASSETS $ARCHIVE/$OLD_REVISION else echo "# $BASENAME: revision $OLD_REVISION already archived" fi diff --git a/bin/assemble b/bin/assemble index cd0836c..3b5b287 100755 --- a/bin/assemble +++ b/bin/assemble @@ -8,26 +8,27 @@ BASENAME="`basename $0 | sed -e 's/\(.\)/\U\1/'`" DIRNAME="`dirname $0`" BASEDIR="$DIRNAME/.." SITE="site" +BOOK="book" NOTEBOOK="notebook" -PUBLIC="public" +BUILD="build" -# Cleanup the previous public folder -rm -rf $PUBLIC +# Cleanup the previous build folder +rm -rf $BUILD # Check if there's a site folder if [ -e "$SITE" ]; then - cp -a $SITE public + cp -a $SITE $BUILD - if [ -e "compiled" ]; then - mv compiled public/book + if [ -e "$BOOK" ]; then + mv $BOOK $BUILD/book fi else - if [ -e "compiled" ]; then - mv compiled public + if [ -e "$BOOK" ]; then + mv $BOOK $BUILD fi fi # Check if there's a notebook if [ -e "$NOTEBOOK" ]; then - mv $NOTEBOOK public/notes + mv $NOTEBOOK $BUILD/notes fi diff --git a/bin/provision-host b/bin/provision-host index 13b8a78..81cf602 100755 --- a/bin/provision-host +++ b/bin/provision-host @@ -44,9 +44,9 @@ cat <<-EOF | $SUDO tee /etc/apache2/sites-available/onion.conf > /dev/null ServerName localhost ServerAlias *.onion - DocumentRoot "/srv/shared/public" + DocumentRoot "/srv/shared/build" - + #AuthType Basic #AuthName "Protected" #AuthUserFile /srv/shared/.htpasswd @@ -62,9 +62,9 @@ EOF cat <<-EOF | $SUDO tee /etc/apache2/sites-available/local.conf > /dev/null ServerName ${PROJECT}.local - DocumentRoot "/srv/shared/public" + DocumentRoot "/srv/shared/build" - + #AuthType Basic #AuthName "Protected" #AuthUserFile /srv/shared/.htpasswd -- cgit v1.2.3