Add guard for git-sync-all for non-main branch
Only pull/push non-syncing repos (currently nixos and emacs) if on the "main" branch, echo warning message and skip otherwise.
This commit is contained in:
parent
f8c7f1bf55
commit
5db0b3feff
|
@ -46,8 +46,12 @@ for i in "${!PULL_DIRS[@]}"; do
|
|||
fi
|
||||
(
|
||||
cd "$DIRECTORY" || exit
|
||||
git remote set-url origin "$URL"
|
||||
git pull --ff-only
|
||||
git push
|
||||
if [ "$(git branch --show-current)" = "main" ]; then
|
||||
git remote set-url origin "$URL"
|
||||
git pull --ff-only
|
||||
git push
|
||||
else
|
||||
echo "Not syncing repo $DIRECTORY on branch $(git branch --show-current)"
|
||||
fi
|
||||
)
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue