2023-12-16 02:51:57 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-11-25 04:33:31 +00:00
|
|
|
|
2024-08-13 15:42:20 +00:00
|
|
|
if [ $DEBUG != "" ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
2023-12-16 02:51:57 +00:00
|
|
|
|
|
|
|
if [ ! -d "$HOME/.git" ] && [ -d "$HOME/.local/share/yadm/repo.git" ]; then
|
2024-08-13 15:42:20 +00:00
|
|
|
echo "[git-symlinks] Symlinking ~/.git to ~/.local/share/yadm/repo.git for compatibility"
|
2023-11-25 04:38:24 +00:00
|
|
|
ln -s ~/.local/share/yadm/repo.git ~/.git
|
2023-12-16 02:51:57 +00:00
|
|
|
elif [ -d "$HOME/.git" ] && [ ! -d "$HOME/.local/share/yadm/repo.git" ]; then
|
2024-08-13 15:42:20 +00:00
|
|
|
echo "[git-symlinks] Symlinking ~/.local/share/yadm/repo.git to ~/.git for compatibility"
|
2023-12-16 02:51:57 +00:00
|
|
|
ln -s ~/.git ~/.local/share/yadm/repo.git
|
2024-08-13 15:42:20 +00:00
|
|
|
else
|
|
|
|
echo "[git-symlinks] Looks like everything is all clear on git"
|
2023-11-25 04:38:24 +00:00
|
|
|
fi
|
|
|
|
|
2024-08-13 15:42:20 +00:00
|
|
|
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
|