dotfiles/.config/yadm/bootstrap.d/00-post-clone-repo.sh
Andrei Jiroh Halili 738b7684cb
chore(yadm): update README and add post-clone bootstrap script
Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.eu.org>
2023-12-16 10:51:57 +08:00

15 lines
627 B
Bash
Executable file

#!/usr/bin/env bash
set -x
if [ ! -d "$HOME/.git" ] && [ -d "$HOME/.local/share/yadm/repo.git" ]; then
echo "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 "Symlinking ~/.local/share/yadm/repo.git to ~/.git for compatibility"
ln -s ~/.git ~/.local/share/yadm/repo.git
fi
echo "Setting git remote URLs to SSH"
git remote set-url origin ssh://git@mau.dev/andreijiroh.dev/dotfiles || true
git remote set-url hut ssh://git@git.sr.ht/~ajhalili2006/dotfiles || true