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
9d249bf6bb
commit
393843cf2e
|
@ -46,8 +46,12 @@ for i in "${!PULL_DIRS[@]}"; do
|
||||||
fi
|
fi
|
||||||
(
|
(
|
||||||
cd "$DIRECTORY" || exit
|
cd "$DIRECTORY" || exit
|
||||||
git remote set-url origin "$URL"
|
if [ "$(git branch --show-current)" = "main" ]; then
|
||||||
git pull --ff-only
|
git remote set-url origin "$URL"
|
||||||
git push
|
git pull --ff-only
|
||||||
|
git push
|
||||||
|
else
|
||||||
|
echo "Not syncing repo $DIRECTORY on branch $(git branch --show-current)"
|
||||||
|
fi
|
||||||
)
|
)
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue