/
Makefile
54 lines (48 loc) · 1.85 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
.PHONY: help install
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
install: ## Installs dotfiles into current environment
@$(MAKE) DOTFILE=.aliases install_file
@$(MAKE) DOTFILE=.atom/config.cson install_file
@$(MAKE) DOTFILE=.brew install_file
@$(MAKE) DOTFILE=.exports install_file
@$(MAKE) DOTFILE=.functions install_file
@$(MAKE) DOTFILE=.gitconfig install_file
@$(MAKE) DOTFILE=.gitignore install_file
@$(MAKE) DOTFILE=.hyper.js install_file
@$(MAKE) DOTFILE=.oh-my-zsh/themes/eko.zsh-theme install_file
@$(MAKE) DOTFILE=.sources install_file
@$(MAKE) DOTFILE=.tmux.conf install_file
@$(MAKE) DOTFILE=.vimrc install_file
@$(MAKE) DOTFILE=.zshrc install_file
install-encrypted: ## Installs encrypted dotfiles into current environment
@$(MAKE) DOTFILE=.ssh/config install_encrypted_file
@$(MAKE) DOTFILE=.otpkeys install_encrypted_file
install_file:
@if [ ! -f ${HOME}/${DOTFILE} ]; then \
echo ✔ Installing file: ${HOME}/${DOTFILE}; \
cp ${DOTFILE} ${HOME}/${DOTFILE}; \
else \
echo ✖ File already exists: ${HOME}/${DOTFILE}; \
fi \
install_encrypted_file:
@if [ ! -f ${HOME}/${DOTFILE} ]; then \
echo ✔ Installing encrypted file: ${HOME}/${DOTFILE}; \
gpg2 --decrypt .encrypted/${DOTFILE} 2> /dev/null > ${HOME}/${DOTFILE}; \
else \
echo ✖ File already exists: ${HOME}/${DOTFILE}; \
fi \
retrieve-files: ## Synchronize files from local host to git repository
cp ~/.aliases .aliases
cp ~/.brew .brew
cp ~/.atom/config.cson .atom/config.cson
cp ~/.exports .exports
cp ~/.functions .functions
cp ~/.gitconfig .gitconfig
cp ~/.gitignore .gitignore
cp ~/.hyper.js .hyper.js
cp ~/.oh-my-zsh/themes/eko.zsh-theme .oh-my-zsh/themes/eko.zsh-theme
cp ~/.sources .sources
cp ~/.tmux.conf .tmux.conf
cp ~/.vimrc .vimrc
cp ~/.zshrc .zshrc