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:
Andrei Jiroh Halili 2024-08-13 23:54:16 +08:00
parent add93e3ec0
commit d7a95fa880
No known key found for this signature in database
GPG key ID: 67BFC91B3DA12BE8
3 changed files with 32 additions and 20 deletions

View file

@ -8,18 +8,23 @@
set -eu set -eu
if [[ $DEBUG != "" ]]; then
set -x
fi
# Directory to look for bootstrap executables in # Directory to look for bootstrap executables in
BOOTSTRAP_D="${BASH_SOURCE[0]}.d" BOOTSTRAP_D="${BASH_SOURCE[0]}.d"
if [[ ! -d "$BOOTSTRAP_D" ]]; then 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 exit 1
fi fi
find -L "$BOOTSTRAP_D" -type f | sort | while IFS= read -r bootstrap; do find -L "$BOOTSTRAP_D" -type f | sort | while IFS= read -r bootstrap; do
if [[ -x "$bootstrap" && ! "$bootstrap" =~ "##" && ! "$bootstrap" =~ "~$" ]]; then if [[ -x "$bootstrap" && ! "$bootstrap" =~ "##" && ! "$bootstrap" =~ "~$" ]]; then
echo "[bootstrap] running $bootstrap"
if ! "$bootstrap"; then if ! "$bootstrap"; then
echo "Error: bootstrap '$bootstrap' failed" >&2 echo "[bootstrap] Error: bootstrap '$bootstrap' failed" >&2
exit 1 exit 1
fi fi
fi fi

View file

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

View file

@ -25,19 +25,19 @@
# authentication hellscape # authentication hellscape
[credential "https://github.com"] [credential "https://github.com"]
helper = helper =
helper = !/usr/bin/gh auth git-credential helper = !gh auth git-credential
[credential "https://gist.github.com"] [credential "https://gist.github.com"]
helper = helper =
helper = !/usr/bin/gh auth git-credential helper = !gh auth git-credential
[credential "https://gitlab.com"] [credential "https://gitlab.com"]
helper = helper =
helper = !/usr/bin/glab auth git-credential helper = !glab auth git-credential
[credential "https://mau.dev"] [credential "https://mau.dev"]
helper = helper =
helper = !/usr/bin/glab auth git-credential helper = !glab auth git-credential
[credential "https://gitlab.alpinelinux.org"] [credential "https://gitlab.alpinelinux.org"]
helper = helper =
helper = !/usr/bin/glab auth git-credential helper = !glab auth git-credential
# sendemail stuff (https://go.recaptime.eu.org/sendgmail) # sendemail stuff (https://go.recaptime.eu.org/sendgmail)
#[sendemail] #[sendemail]
@ -82,8 +82,8 @@
# path = ~/.config/git/ajhalili2006-experiments.include.gitconfig # path = ~/.config/git/ajhalili2006-experiments.include.gitconfig
#[includeIf "gitdir/i:~/projects/labs.andreijiroh.dev"] #[includeIf "gitdir/i:~/projects/labs.andreijiroh.dev"]
# path = ~/.config/git/ajhalili2006-experiments.include.gitconfig # path = ~/.config/git/ajhalili2006-experiments.include.gitconfig
[includeIf "gitdir/i:~/git-projects/recaptime.dev/"] #[includeIf "gitdir/i:~/git-projects/recaptime.dev/"]
path = ~/.config/git/recaptime-dev.include.gitconfig # path = ~/.config/git/recaptime-dev.include.gitconfig
[includeIf "gitdir/i:~/projects/recaptime.dev/"] [includeIf "gitdir/i:~/projects/recaptime.dev/"]
path = ~/.config/git/recaptime-dev.include.gitconfig path = ~/.config/git/recaptime-dev.include.gitconfig
[includeIf "gitdir/i:/workspaces/recaptime.dev/"] [includeIf "gitdir/i:/workspaces/recaptime.dev/"]
@ -107,3 +107,5 @@
command = echo \"$(git config user.name) <$(git config user.email)>\" command = echo \"$(git config user.name) <$(git config user.email)>\"
[push] [push]
autoSetupRemote = true autoSetupRemote = true
[safe]
directory = /storage/emulated/0/Documents/git/recaptime-dev/proxyparty