Allow specifying the branch of the Hugo project.

This commit is contained in:
2025-08-19 15:03:12 -07:00
parent 4aa7fa4b00
commit 2663bb5351
3 changed files with 14 additions and 7 deletions

View File

@@ -1,18 +1,24 @@
#!/usr/bin/env bash
REPO="$1"
echo "REPO=$REPO"
echo "REPO='$REPO'"
PROD="$2"
BRANCH="$2"
if [[ -n $BRANCH ]]; then
BRANCH="--branch $BRANCH"
fi
echo "BRANCH='$BRANCH'"
PROD="$3"
typeset -u PROD
echo "PROD=$PROD"
echo "PROD='$PROD'"
DEV="$3"
DEV="$4"
typeset -u DEV
echo "DEV=$DEV"
echo "DEV='$DEV'"
echo "*** Creating Git Repo ***"
sudo -u www-data git clone --recurse-submodules $REPO /var/www/hugo/site
sudo -u www-data git clone --recurse-submodules $BRANCH $REPO /var/www/hugo/site
status="$?"
echo "*** Validating Git Repo ***"