From b2f0f3e08da3956c5f9d2774df5f6af82e07a59b Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Wed, 14 Feb 2024 08:34:30 +0000 Subject: [PATCH] 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 --- home/scripts/git-sync-all.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/home/scripts/git-sync-all.sh b/home/scripts/git-sync-all.sh index 53be1e61..771c065a 100755 --- a/home/scripts/git-sync-all.sh +++ b/home/scripts/git-sync-all.sh @@ -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 ---" + if [ ! -d "$DIRECTORY" ]; then + git clone "$URL" "$DIRECTORY" + fi ( cd "$DIRECTORY" || exit + git remote set-url origin "$URL" git-sync -ns ) done