generated from me/template-mit
Add a script for uploading MASTER catalogs automagically, so the location of the trailing slash can't accidentally be swapped. ;)
This commit is contained in:
17
bin/send-to-server.sh
Executable file
17
bin/send-to-server.sh
Executable file
@@ -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
|
||||
Reference in New Issue
Block a user