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