dotfiles/.config/yadm/bootstrap.d/00-post-clone-repo.sh
Andrei Jiroh Halili cbeb6b6b85
chore(termux): update readme for termux setup and then some
Also adding some debugging-related chores btw.

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.xyz>
2024-08-13 23:42:20 +08:00

20 lines
856 B
Bash
Executable file

#!/usr/bin/env bash
if [ $DEBUG != "" ]; then
set -x
fi
if [ ! -d "$HOME/.git" ] && [ -d "$HOME/.local/share/yadm/repo.git" ]; then
echo "[git-symlinks] Symlinking ~/.git to ~/.local/share/yadm/repo.git for compatibility"
ln -s ~/.local/share/yadm/repo.git ~/.git
elif [ -d "$HOME/.git" ] && [ ! -d "$HOME/.local/share/yadm/repo.git" ]; then
echo "[git-symlinks] Symlinking ~/.local/share/yadm/repo.git to ~/.git for compatibility"
ln -s ~/.git ~/.local/share/yadm/repo.git
else
echo "[git-symlinks] Looks like everything is all clear on git"
fi
echo "[git-remotes] Setting git remote URLs to SSH"
git remote set-url --add --push hut ssh://git@git.sr.ht/~ajhalili2006/dotfiles \
|| git remote add hut https://git.sr.ht/~ajhalili2006/dotfiles \
&& git remote set-url --add --push hut ssh://git@git.sr.ht/~ajhalili2006/dotfiles