Compare commits

..

15 Commits

Author SHA1 Message Date
b94a3e4a0b Add an explicit bye since goodbye does not seem to be working still? 2026-03-27 17:09:42 -07:00
9c9de6f96f Add function which syncs all the MASTER catalogs in the current directory. 2026-03-27 17:07:24 -07:00
c5d1386211 Add another TODO to master sync script. 2026-03-27 17:06:48 -07:00
9f6c7834d8 Add comments and TBD's. 2026-03-23 12:31:42 -07:00
bbf7bd5606 Add comments to script. 2026-03-23 12:25:55 -07:00
3f4d3363af Finish the script for the shared config to update itself. Add aliases. 2026-03-23 12:24:11 -07:00
8e3c581d16 Rename file for better code highlighting. 2026-03-23 12:21:39 -07:00
3de906a03f Create alias with dash for script. 2026-03-23 12:13:57 -07:00
1c919cb4d9 Use underscore in script filename as well. 2026-03-23 12:13:46 -07:00
8bf6b5905c Use underscore in name. 2026-03-23 12:13:00 -07:00
3c6a0994c6 Edit note to be more stern yet kind. ;) 2026-03-23 12:08:40 -07:00
9bb80b51c4 Add RC file which sources the shared bin. 2026-03-23 12:07:55 -07:00
17a65f6ce0 Rename the bin dir to include shared. 2026-03-23 12:07:49 -07:00
353b38fad4 Rename script to something easier to remember as well as type. 2026-03-23 12:01:51 -07:00
c5a1015083 Add a script for uploading MASTER catalogs automagically, so the location of the trailing slash can't accidentally be swapped. ;) 2026-03-23 12:00:07 -07:00
2 changed files with 96 additions and 0 deletions

33
bin-shared/send_master.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
# TBD:
# - ensure all SERVER_* variables actually exist in environment
# - test the script :)
# - add parameter to set loop=true
# - allow passing the script a variable for the dir, rather than assuming curr
## Variables ##
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
loop=false
## Validations ##
if [[ "$DIR" != *"MASTER" ]]; then
echo "This directory is not labeled as a MASTER. Skipping upload."
exit 0
fi
## Main ##
new_dir="`basename $DIR`"
new_dir="${new_dir//MASTER/clone}"
do
clone -e "ssh -p $SERVER_PORT" ./ $SERVER_USER@$SERVER_NAME:$SERVER_SFTP/$new_dir
while $loop
## Complete ##
echo "Done!"
exit 0

63
rc_shared.sh Normal file
View File

@@ -0,0 +1,63 @@
# Notes:
# - Please keep this file working for both BASH and ZSH. :)
echo "Shared RC Config - Loading..."
## Variables ##
# Environment Usability
export PATH="$PATH:~/bin-shared:~/.bin-shared"
## Aliases ##
## Functions ##
# Related specifically to this project.
function update-shared {
branch="$1"
if [[ -z "$branch" ]]; then
branch="dev"
fi
git clone GIT_PROTOCOL://git@GIT_HOSTNAME:$GIT_PORT/env-shared \
shared-deleteme --branch=$branch
mv -v ~/.rc_shared ~/.bin_shared ~/TRASH/
mv -v shared-deleteme/rc_shared.sh ~/.rc_shared
mv -v shared-deleteme/bin_shared ~/.bin_shared
mv -v shared-deleteme ~/TRASH/shared-deleteme-`date "+%Y%m%d-%H%M%S"`
}
alias shared-update="update-shared"
alias reload-shared="update-shared"
alias shared-reload="update-shared"
# Shortcuts
function send-master { send_master.sh; }
function goodbye { update -y; bye; }
# Enhance Bin Scripts
function send-masters {
ls | grep MASTER | while read dir; do
echo "Preparing to sync '$dir' to '$SERVER_NAME'."
cd $dir
send-master
cd ..
done
}
# Audio
# Video
## Complete! ##
echo "Shared RC Config - Complete!"