From 03dd8b3cd8d03300ee85377ea40fa486819d2ebc Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Wed, 6 Mar 2024 14:59:00 -0500 Subject: Update shortcutgen env and misc others --- .local/bin/upsite | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to '.local/bin/upsite') diff --git a/.local/bin/upsite b/.local/bin/upsite index c6ef404..5b15d21 100755 --- a/.local/bin/upsite +++ b/.local/bin/upsite @@ -1,11 +1,28 @@ #!/bin/sh -sitename="chausse.xyz" +username="master" +url="chausse.xyz" +siteroot="$HOME/Workspace/$url" -branch="construction" - -cd "$HOME/Workspace/$sitename$construction" && git pull origin $branch && git checkout $branch +case "$1" in + -d|--dev) + url="dev.$url" + destdir="/var/www/dev" + branch="master" + ;; + -m|--main) + destdir="/var/www/chausse" + branch="construction" + ;; + *) + echo "Usage: upsite [dev|main]" + exit 1 + ;; +esac +cd "$siteroot" || exit 1 +git checkout $branch +git pull hugo --gc=true --minify +rsync -aucz --delete --progress "$siteroot/public/" "$username@$url:$destdir" -rsync -auvz "$HOME/Workspace/$sitename$construction/public/" "master@$sitename:/var/www/chausse" -- cgit v1.2.3