aboutsummaryrefslogtreecommitdiffstats
path: root/git/Makefile
blob: 1794675f552790fa45d6f66d9af0af56cc769b22 (plain) (blame)
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
.POSIX:

install:
	mkdir -p -- ~/.config/git
	test ! -e ~/.config/git/config || test -L ~/.config/git/config
	test ! -e ~/.config/git/config || test -f ~/.config/git/config
	cp -- config .config
	if test -f ../.secrets/git/config; then\
		cat -- ../.secrets/git/config >> .config;\
	fi
	if test -f ../.work/pkgs/git/config; then\
		cat -- ../.work/pkgs/git/config-include >> .config;\
	fi
	ln -sf -- ~/.dotfiles/git/.config ~/.config/git/config
	mkdir -p -- ~/.config/bash/aliases.d
	test ! -d ~/.config/bash/aliases.d/git
	ln -sf -- ~/.dotfiles/git/bash-aliases ~/.config/bash/aliases.d/git
	../check-installed-shebang ge
	mkdir -p -- ~/.local/bin
	ln -sf -- ~/.dotfiles/git/ge ~/.local/bin/
	ln -sf -- ~/.dotfiles/git/new-c-proj ~/.local/bin/

uninstall:
	+! ../check-installed git
	-unlink -- ~/.config/git/config
	-rmdir -- ~/.config/git/
	-unlink -- ~/.config/bash/aliases.d/git
	-rmdir -- ~/.config/bash/aliases.d
	-unlink -- ~/.local/bin/ge
	-unlink -- ~/.local/bin/new-c-proj

clean:
	-rm -f -- .config