Remove the pull-only stage of git-sync-all.sh
This commit is contained in:
parent
a15a58450d
commit
ba00c4c015
|
@ -24,34 +24,3 @@ for i in "${!SYNC_DIRS[@]}"; do
|
|||
git status --porcelain
|
||||
)
|
||||
done
|
||||
|
||||
# Pull NixOS, home-manager and Emacs configs if simple fast-forward
|
||||
PULL_DIRS=(
|
||||
"${XDG_CONFIG_HOME:-$HOME/.config}/nixos"
|
||||
"${XDG_CONFIG_HOME:-$HOME/.config}/home-manager"
|
||||
"${XDG_CONFIG_HOME:-$HOME/.config}/emacs"
|
||||
)
|
||||
PULL_URLS=(
|
||||
"https://git.xenia.me.uk/pixelifytica/nixos.git"
|
||||
"https://git.xenia.me.uk/pixelifytica/home-manager.git"
|
||||
"https://git.xenia.me.uk/pixelifytica/emacs.git"
|
||||
)
|
||||
for i in "${!PULL_DIRS[@]}"; do
|
||||
DIRECTORY="${PULL_DIRS[$i]}"
|
||||
URL="${PULL_URLS[$i]}"
|
||||
echo "--- pull: $DIRECTORY ---"
|
||||
if [ ! -d "$DIRECTORY" ]; then
|
||||
git clone "$URL" "$DIRECTORY"
|
||||
fi
|
||||
(
|
||||
cd "$DIRECTORY" || exit
|
||||
if [ "$(git branch --show-current)" = "main" ]; then
|
||||
git remote set-url origin "$URL"
|
||||
git pull --ff --ff-only
|
||||
git push
|
||||
else
|
||||
echo "Not syncing repo $DIRECTORY on branch $(git branch --show-current)"
|
||||
fi
|
||||
git status --porcelain
|
||||
)
|
||||
done
|
||||
|
|
Reference in a new issue