Add pull step back to git-sync-all.sh
Pulls ~/.emacs.d/ and ~/.config/home-manager/
This commit is contained in:
parent
fd35f72cd2
commit
0e45bbe456
|
@ -1,16 +1,27 @@
|
||||||
# Clone ~/.emacs.d/ if it doesn't exist, pull otherwise (ff only)
|
# Clone ~/.emacs.d/ and ~/.config/home-manager if then don't exist,
|
||||||
DIRECTORY="$HOME/.emacs.d/"
|
# pull otherwise (ff only)
|
||||||
URL="https://git.xenia.me.uk/pixelifytica/emacs.git"
|
PULL_DIRS=(
|
||||||
echo "--- ~/.emacs.d/ ---"
|
"$HOME/.emacs.d/"
|
||||||
if [ ! -d "$DIRECTORY" ]; then
|
"${XDG_CONFIG_HOME:-$HOME/.config}/home-manager"
|
||||||
|
)
|
||||||
|
PULL_URLS=(
|
||||||
|
"https://git.xenia.me.uk/pixelifytica/emacs.git"
|
||||||
|
"https://git.xenia.me.uk/pixelifytica/home-manager.git"
|
||||||
|
)
|
||||||
|
for i in "${!PULL_DIRS[@]}"; do
|
||||||
|
DIRECTORY="${PULL_DIRS[$i]}"
|
||||||
|
URL="${PULL_URLS[$i]}"
|
||||||
|
echo "--- $DIRECTORY ---"
|
||||||
|
if [ ! -d "$DIRECTORY" ]; then
|
||||||
git clone "$URL" "$DIRECTORY"
|
git clone "$URL" "$DIRECTORY"
|
||||||
fi
|
fi
|
||||||
(
|
(
|
||||||
cd "$DIRECTORY" || exit
|
cd "$DIRECTORY" || exit
|
||||||
git remote set-url origin "$URL"
|
git remote set-url origin "$URL"
|
||||||
git pull --ff --ff-only
|
git pull --ff --ff-only
|
||||||
git status --porcelain
|
git status --porcelain
|
||||||
)
|
)
|
||||||
|
done
|
||||||
|
|
||||||
# Sync common directories, setting url to ensure it's up-to-date first
|
# Sync common directories, setting url to ensure it's up-to-date first
|
||||||
SYNC_DIRS=(
|
SYNC_DIRS=(
|
||||||
|
|
Reference in a new issue