From c5a1015083050726f2e00575e6c64d05c80c940f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 23 Mar 2026 12:00:07 -0700 Subject: [PATCH] Add a script for uploading MASTER catalogs automagically, so the location of the trailing slash can't accidentally be swapped. ;) --- bin/send-to-server.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bin/send-to-server.sh diff --git a/bin/send-to-server.sh b/bin/send-to-server.sh new file mode 100755 index 0000000..f25969a --- /dev/null +++ b/bin/send-to-server.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# TBD: +# - ensure all SERVER_* variables actually exist in environment +# - test the script :) + +DIR="$(dirname -- "${BASH_SOURCE[0]}")" + +if [[ "$DIR" != *"MASTER" ]]; then + echo "This directory is not labeled as a MASTER. Skipping upload." + exit 0 +fi + +new_dir="`basename $DIR`" +new_dir="${new_dir//MASTER/clone}" + +clone -e "ssh -p $SERVER_PORT" ./ $SERVER_USER@$SERVER_NAME:$SERVER_SFTP/$new_dir