Update git-sync-all
Add extra checks to pull section (ensure directory exists, echo current dir, set URL)
This commit is contained in:
parent
4be59efb4e
commit
f00e8be0a2
|
@ -15,7 +15,7 @@ SYNC_URLS=(
|
||||||
for i in "${!SYNC_DIRS[@]}"; do
|
for i in "${!SYNC_DIRS[@]}"; do
|
||||||
DIRECTORY="${SYNC_DIRS[$i]}"
|
DIRECTORY="${SYNC_DIRS[$i]}"
|
||||||
URL="${SYNC_URLS[$i]}"
|
URL="${SYNC_URLS[$i]}"
|
||||||
echo "--- $DIRECTORY ---"
|
echo "--- sync: $DIRECTORY ---"
|
||||||
if [ ! -d "$DIRECTORY" ]; then
|
if [ ! -d "$DIRECTORY" ]; then
|
||||||
git clone "$URL" "$DIRECTORY"
|
git clone "$URL" "$DIRECTORY"
|
||||||
fi
|
fi
|
||||||
|
@ -27,5 +27,24 @@ for i in "${!SYNC_DIRS[@]}"; do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Pull NixOS and Emacs config if simple fast-forward
|
# Pull NixOS and Emacs config if simple fast-forward
|
||||||
git -C /etc/nixos pull --ff-only
|
PULL_DIRS=(
|
||||||
git -C "${XDG_CONFIG_HOME:-$HOME/.config}/emacs" pull --ff-only
|
"/etc/nixos"
|
||||||
|
"${XDG_CONFIG_HOME:-$HOME/.config}/emacs"
|
||||||
|
)
|
||||||
|
PULL_URLS=(
|
||||||
|
"https://git.xenia.me.uk/pixelifytica/nixos.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
|
||||||
|
git remote set-url origin "$URL"
|
||||||
|
git pull --ff-only
|
||||||
|
)
|
||||||
|
done
|
||||||
|
|
Loading…
Reference in a new issue