From fd0b71dd493650c72337f283823f3da09edde9ef Mon Sep 17 00:00:00 2001 From: Sean Starkey Date: Wed, 27 May 2026 17:11:06 -0600 Subject: [PATCH] Protect subdirectories during deploy --- deploy.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index d7e1a07..746414a 100755 --- a/deploy.sh +++ b/deploy.sh @@ -4,6 +4,9 @@ set -e SRC_DIR="./" DEST_DIR_TEST="/var/www/staging.seanstarkey.dev/public" DEST_DIR_PROD="/var/www/seanstarkey.dev/public" +PROTECTED_DIRS=( + "Hallowdeep" +) usage() { echo "Usage: $0 [test|prod]" @@ -32,6 +35,16 @@ echo "Deploying from '$SRC_DIR' to '$DEST_DIR'..." #mkdir -p "$DEST_DIR" -sudo rsync -av --delete --exclude .git --exclude deploy.sh --exclude '.*.swp' "$SRC_DIR" "$DEST_DIR" +RSYNC_EXCLUDES=( + --exclude .git + --exclude deploy.sh + --exclude '.*.swp' +) + +for dir in "${PROTECTED_DIRS[@]}"; do + RSYNC_EXCLUDES+=(--exclude "$dir/") +done + +sudo rsync -av --delete "${RSYNC_EXCLUDES[@]}" "$SRC_DIR" "$DEST_DIR" echo "Deployment complete."