Update git-sync-all script

Add elfeed directory back now that I'm ignoring the db entries
properly

Add urls for repositories so that script can clone them if the
directory doesn't already exist, and ensure correct remote url is set
before syncing
This commit is contained in:
Evie Litherland-Smith 2024-02-14 08:34:30 +00:00
parent 0790477d64
commit b2f0f3e08d

View file

@ -1,9 +1,26 @@
git -C "$HOME/.emacs/" pull --ff-only SYNC_DIRS=(
"$HOME/.password-store/"
"$HOME/.elfeed/"
"$HOME/Documents/Org/"
"$HOME/Documents/References/"
)
SYNC_URLS=(
"https://git.xenia.me.uk/xenia/pass.git"
"https://git.xenia.me.uk/xenia/elfeed.git"
"https://git.xenia.me.uk/xenia/org.git"
"https://git.xenia.me.uk/xenia/references.git"
)
for DIRECTORY in $HOME/.password-store $HOME/Documents/Org $HOME/Documents/References; do for i in "${!SYNC_DIRS[@]}"; do
DIRECTORY="${SYNC_DIRS[$i]}"
URL="${SYNC_URLS[$i]}"
echo "--- $DIRECTORY ---" echo "--- $DIRECTORY ---"
if [ ! -d "$DIRECTORY" ]; then
git clone "$URL" "$DIRECTORY"
fi
( (
cd "$DIRECTORY" || exit cd "$DIRECTORY" || exit
git remote set-url origin "$URL"
git-sync -ns git-sync -ns
) )
done done