From eeb8972fe64351aecf406e2612c726ca58917f33 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 5 Feb 2024 06:22:44 +0000 Subject: [PATCH] Fix lint suggestions for git-sync-all Use subshell for each directory rather than cd and cd back Add git-sync option to sync new files --- home/scripts/git-sync-all.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/home/scripts/git-sync-all.sh b/home/scripts/git-sync-all.sh index 2b644b09..ad2d762d 100755 --- a/home/scripts/git-sync-all.sh +++ b/home/scripts/git-sync-all.sh @@ -1,10 +1,9 @@ -git -C $HOME/.emacs/ pull --ff-only +git -C "$HOME/.emacs/" pull --ff-only for DIRECTORY in $HOME/.password-store $HOME/.elfeed $HOME/Documents/Org $HOME/Documents/References; do echo "--- $DIRECTORY ---" - mkdir -p $DIRECTORY - cd $DIRECTORY - git config --bool branch.main.sync true - git-sync - cd - + ( + cd "$DIRECTORY" || exit + git-sync -ns + ) done