mirror of
https://mau.dev/andreijiroh-dev/dotfiles.git
synced 2025-05-17 02:53:08 +00:00
chore(global): apply patches from termux branch
See-Also:00aa74c825
See-Also:cbeb6b6b85
Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.xyz>
This commit is contained in:
parent
add93e3ec0
commit
d7a95fa880
3 changed files with 32 additions and 20 deletions
|
@ -8,18 +8,23 @@
|
|||
|
||||
set -eu
|
||||
|
||||
if [[ $DEBUG != "" ]]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Directory to look for bootstrap executables in
|
||||
BOOTSTRAP_D="${BASH_SOURCE[0]}.d"
|
||||
|
||||
if [[ ! -d "$BOOTSTRAP_D" ]]; then
|
||||
echo "Error: bootstrap directory '$BOOTSTRAP_D' not found" >&2
|
||||
echo "[bootstrap] Error: bootstrap directory '$BOOTSTRAP_D' not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
find -L "$BOOTSTRAP_D" -type f | sort | while IFS= read -r bootstrap; do
|
||||
if [[ -x "$bootstrap" && ! "$bootstrap" =~ "##" && ! "$bootstrap" =~ "~$" ]]; then
|
||||
echo "[bootstrap] running $bootstrap"
|
||||
if ! "$bootstrap"; then
|
||||
echo "Error: bootstrap '$bootstrap' failed" >&2
|
||||
echo "[bootstrap] Error: bootstrap '$bootstrap' failed" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -1,15 +1,20 @@
|
|||
#!/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
|
||||
if [ $DEBUG != "" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
echo "Setting git remote URLs to SSH"
|
||||
git remote set-url --add origin ssh://git@mau.dev/andreijiroh.dev/dotfiles || true
|
||||
git remote set-url --add hut ssh://git@git.sr.ht/~ajhalili2006/dotfiles || git remote add hut ssh://git@git.sr.ht/~ajhalili2006/dotfiles
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue