-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·62 lines (46 loc) · 1.35 KB
/
Copy pathuninstall.sh
File metadata and controls
executable file
·62 lines (46 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
# q1sh101 - dotfiles uninstaller
# removes only symlinks that point back to this repo
set -euo pipefail
_dotfiles="$(cd "$(dirname "$0")" && pwd)"
removed=0
unlink() {
local dst="$1"
# only remove if it's a symlink pointing into our repo
if [[ -L "$dst" ]] && [[ "$(readlink -- "$dst")" == "$_dotfiles" || "$(readlink -- "$dst")" == "$_dotfiles/"* ]]; then
rm -f -- "$dst" || { echo " error: remove failed for $dst" >&2; return 1; }
echo " $dst"
removed=$((removed+1))
fi
}
echo "uninstall: $_dotfiles"
echo ""
# --- root ---
unlink "$HOME/.dotfiles"
# --- identity/shell ---
unlink "$HOME/.zshenv"
unlink "$HOME/.zshrc"
unlink "$HOME/.paths"
unlink "$HOME/.aliases"
unlink "$HOME/.functions"
# --- identity/git ---
unlink "$HOME/.config/git/config"
unlink "$HOME/.config/git/ignore"
unlink "$HOME/.config/git/hooks/pre-commit"
# --- identity/gpg ---
unlink "$HOME/.gnupg/gpg.conf"
unlink "$HOME/.gnupg/gpg-agent.conf"
# --- identity/ssh ---
unlink "$HOME/.ssh/config"
# --- identity/tmux ---
unlink "$HOME/.tmux.conf"
unlink "$HOME/.local/bin/git-status"
# --- apps/alacritty ---
unlink "$HOME/.config/alacritty/alacritty.toml"
# --- apps/ranger ---
unlink "$HOME/.config/ranger/rc.conf"
# --- apps/ripgrep ---
unlink "$HOME/.config/ripgrep/config"
rm -f "$HOME/.zcompdump"*
echo ""
echo "done. removed $removed symlinks."