-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
182 lines (154 loc) · 6.05 KB
/
Copy pathMakefile
File metadata and controls
182 lines (154 loc) · 6.05 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
INSTALL := ./install
ALL_GROUPS := base,darwin,x11,thinkpad,i3,ai
.DEFAULT_GOAL := help
.PHONY: help install update up update-zinit update-mise update-pi update-hunk update-herdr update-brew update-gh update-nvim update-vim update-doom update-tmux update-mas update-dotbot update_dotbot uninstall uninstall-ai base server darwin mac thinkpad i3 ai
help:
@printf '%s\n' \
'Targets:' \
' make base install base dotfiles' \
' make server install server-safe base dotfiles' \
' make darwin install base + darwin dotfiles' \
' make thinkpad install base + x11 + thinkpad dotfiles' \
' make i3 install i3 dotfiles' \
' make ai install AI tool dotfiles' \
' make uninstall-ai remove all managed AI tools and dotfiles' \
' make update update user-managed dependencies' \
' make update-zinit update Zinit and Zinit-managed plugins' \
' make update-mise update tools installed by mise' \
' make update-pi update installed Pi extensions and model catalogs' \
' make update-hunk update installed Hunk extensions' \
' make update-herdr update GitHub-installed Herdr plugins' \
' make update-brew update Homebrew formulae and casks' \
' make update-gh update GitHub CLI extensions' \
' make update-nvim update Neovim plugins and lazy-lock.json' \
' make update-vim update Vim plugins through vim-plug' \
' make update-doom update Doom Emacs' \
' make update-tmux update installed tmux plugins' \
' make update-mas update Mac App Store applications' \
' make update-dotbot update the pinned Dotbot revision' \
' make uninstall uninstall all linked groups'
install:
@$(INSTALL) $(ARGS)
up: update
update:
@$(MAKE) --no-print-directory update-zinit
@$(MAKE) --no-print-directory update-mise
@$(MAKE) --no-print-directory update-pi
@$(MAKE) --no-print-directory update-hunk
@$(MAKE) --no-print-directory update-herdr
@$(MAKE) --no-print-directory update-gh
@$(MAKE) --no-print-directory update-nvim
@$(MAKE) --no-print-directory update-vim
@$(MAKE) --no-print-directory update-doom
@$(MAKE) --no-print-directory update-tmux
@$(MAKE) --no-print-directory update-dotbot
update-zinit:
@if command -v zsh >/dev/null 2>&1; then \
zsh -ic 'if ! command -v zinit >/dev/null 2>&1; then print -r -- "Skipping Zinit update: Zinit is not installed"; exit 0; fi; zinit self-update || exit; for plugin_dir in "$$ZINIT[PLUGINS_DIR]"/*(N/); do plugin=$${plugin_dir:t}; [[ $$plugin = custom || $$plugin = _local---zinit ]] && continue; zinit update "$${plugin//---//}" || exit; done'; \
else \
printf '%s\n' 'Skipping Zinit update: zsh is not installed'; \
fi
update-mise:
@if command -v mise >/dev/null 2>&1; then \
mise up --yes; \
else \
printf '%s\n' 'Skipping mise update: mise is not installed'; \
fi
update-pi:
@if command -v pi >/dev/null 2>&1; then \
pi update --extensions && pi update --models; \
else \
printf '%s\n' 'Skipping Pi update: pi is not installed'; \
fi
update-hunk:
@if command -v hunk >/dev/null 2>&1; then \
hunk extension update; \
else \
printf '%s\n' 'Skipping Hunk extension update: hunk is not installed'; \
fi
update-herdr:
@if ! command -v herdr >/dev/null 2>&1; then \
printf '%s\n' 'Skipping Herdr plugin update: herdr is not installed'; \
elif ! command -v jq >/dev/null 2>&1; then \
printf '%s\n' 'Skipping Herdr plugin update: jq is not installed'; \
else \
sources=$$(herdr plugin list --json | jq -r '.result.plugins[].source | select(.kind == "github") | .owner + "/" + .repo + (if (.subdir // "") == "" then "" else "/" + .subdir end)' | sort -u); \
if [ -z "$$sources" ]; then \
printf '%s\n' 'Skipping Herdr plugin update: no GitHub plugins installed'; \
else \
printf '%s\n' "$$sources" | while IFS= read -r source; do \
herdr plugin install "$$source" --yes || exit; \
done; \
fi; \
fi
update-brew:
@if command -v brew >/dev/null 2>&1; then \
brew update && brew upgrade; \
else \
printf '%s\n' 'Skipping Homebrew update: brew is not installed'; \
fi
update-gh:
@if command -v gh >/dev/null 2>&1; then \
gh extension upgrade --all; \
else \
printf '%s\n' 'Skipping GitHub CLI extension update: gh is not installed'; \
fi
update-nvim:
@if command -v nvim >/dev/null 2>&1; then \
nvim --headless '+Lazy! update' +qa; \
else \
printf '%s\n' 'Skipping Neovim update: nvim is not installed'; \
fi
update-vim:
@if command -v nvim >/dev/null 2>&1; then \
printf '%s\n' 'Skipping Vim plugin update: Neovim is installed'; \
elif ! command -v vim >/dev/null 2>&1; then \
printf '%s\n' 'Skipping Vim plugin update: vim is not installed'; \
elif [ ! -r "$$HOME/.vimrc" ] || [ ! -r "$$HOME/.vimrc.bundles" ] || [ ! -r "$$HOME/.vim/autoload/plug.vim" ]; then \
printf '%s\n' 'Skipping Vim plugin update: vim-plug is not installed'; \
else \
vim -Nu "$$HOME/.vimrc" -n -es +'PlugUpgrade' +'PlugUpdate --sync' +qa; \
fi
update-doom:
@if command -v doom >/dev/null 2>&1; then \
doom upgrade; \
else \
printf '%s\n' 'Skipping Doom update: Doom Emacs is not installed'; \
fi
update-tmux:
@if [ -x "$$HOME/.tmux/plugins/tpm/bin/update_plugins" ]; then \
"$$HOME/.tmux/plugins/tpm/bin/update_plugins" all; \
else \
printf '%s\n' 'Skipping tmux plugin update: TPM is not installed'; \
fi
update-mas:
@if command -v mas >/dev/null 2>&1; then \
mas update; \
else \
printf '%s\n' 'Skipping Mac App Store update: mas is not installed'; \
fi
update-dotbot:
@if command -v git >/dev/null 2>&1; then \
git submodule update --remote --init dotbot && \
git -C dotbot submodule update --init --recursive; \
else \
printf '%s\n' 'Skipping Dotbot update: git is not installed'; \
fi
update_dotbot: update-dotbot
uninstall: export DOTFILE_GROUPS = $(ALL_GROUPS)
uninstall:
@./uninstall.py
uninstall-ai:
@ai/.bin/uninstall-ai
base: export DOTFILE_GROUPS = base
base: install
server: base
darwin: export DOTFILE_GROUPS = base,darwin
darwin: install
mac: darwin
thinkpad: export DOTFILE_GROUPS = base,x11,thinkpad
thinkpad: install
i3: export DOTFILE_GROUPS = i3
i3: install
ai: export DOTFILE_GROUPS = ai
ai: install