-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (38 loc) · 1.22 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
PROJECTS := $(HOME)/code
.PHONY: all
all: dev-deploy
.PHONY: dev-deploy
dev-deploy:
@echo "Symlinking dotfiles..."
@for file in $(shell find $(CURDIR) -name ".*" -not -name ".gitignore" -not -name ".git" -not -name ".*.swp"); do \
f=$$(basename $$file); \
target=$(HOME)/$$f; \
echo -e "\tLinking $$file -> $$target"; \
ln -sfn $$file $$target; \
done
mkdir -p $(HOME)/.config
ln -sfn $(CURDIR)/custom-config.zsh $(HOME)/.oh-my-zsh/custom/custom-config.zsh
.PHONY: remove
remove:
@for file in $(shell find $(CURDIR) -name ".*" -not -name ".gitignore" -not -name ".git" -not -name ".*.swp"); do \
f=$$(basename $$file); \
rm -f $(HOME)/$$f; \
done
.PHONY: deploy
deploy:
@echo "Copying dotfiles..."
@for file in $(shell find $(CURDIR) -name ".*" -not -name ".gitignore" -not -name ".git" -not -name ".*.swp"); do \
f=$$(basename $$file); \
target=$(HOME)/$$f; \
echo -e "\tCopying $$file -> $$target"; \
cp -f $$file $$target; \
done
mkdir -p $(HOME)/.config
.PHONY: hooks
hooks:
@for proj_hook in $(wildcard $(PROJECTS)/*/.git/hooks); do \
base=$(CURDIR)/git-hooks/branch_ticket_name.py; \
target=$$proj_hook/prepare-commit-msg; \
echo -e "\t Linking $$base -> $$target;"; \
ln -sfn $$base $$target; \
done