-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
60 lines (49 loc) · 1.3 KB
/
Makefile
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
all: sync
define check_dir_and_link
@if [ -d $(2) ]; then \
if [ -L $(2) ]; then \
if [ "$$(readlink $(2))" = "$(1)" ]; then \
echo "Directory $(2) is already linked to $(1). Skipping..."; \
else \
echo "Directory $(2) is linked to $$(readlink $(2)). Aborting..."; \
fi; \
else \
mv $(1) $(1).bak; \
mv $(2) $(1); \
ln -s $(1) $(2); \
fi; \
else \
echo "Directory $(2) does not exist. Skipping..."; \
fi
endef
define check
echo $(1)
echo $(2)
endef
test:
$(call check,$$(pwd),$(HOME))
$(call check_dir_and_link,$$(pwd)/.config/alacritty,$(HOME)/.config/alacritty)
sync:
[ -d ~/.doom.d ] || ln -s $(PWD)/.doom.d ~/.doom.d
[ -f ~/.finicky.js ] || ln -s $(PWD)/.finicky.js ~/.finicky.js
[ -f ~/.gitconfig ] || ln -s $(PWD)/.gitconfig ~/.gitconfig
[ -f ~/.tmux.conf ] || ln -s $(PWD)/.tmux.conf ~/.tmux.conf
[ -f ~/.vimrc ] || ln -s $(PWD)/.vimrc ~/.vimrc
[ -f ~/.yabairc ] || ln -s $(PWD)/.yabairc ~/.yabairc
[ -d ~/.config ] || ln -s $(PWD)/.config ~/.config
clean:
rm -rf ~/.doom.d
rm -f ~/.finicky.js
rm -f ~/.gitconfig
rm -f ~/.tmux.conf
rm -f ~/.vimrc
rm -f ~/.yabairc
rm -f ~/.config
update: brew spell
brew:
brew upgrade
mas upgrade
brew bundle dump --describe --force
spell:
typos
.PHONY: all clean sync brew spell update test