-
Notifications
You must be signed in to change notification settings - Fork 48
/
Makefile
61 lines (50 loc) · 1.42 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
# Make file for viewing/editing an encrypted file
# Also to export and port brew installs
GPGID = [email protected]
FILEPLAIN = <foo.txt>
FILECRYPT = $(FILEPLAIN).gpg
GPG = gpg
RM = /bin/rm -i
VI = vim
BREW = brew
CP = cp
MAC_INSTALL := ./install_dotfiles -p mac
LINUX_INSTALL := ./install_dotfiles -p linux
DOTFILE_HELP := ./install_dotfiles -h
BREWFILE := ./Work.Brewfile
DAY := $(shell date +"%H-%M-%S-%d-%m-%Y")
BREWFILEBAK := $(BREWFILE).$(DAY)
UMASK := 0077
all:
@echo ""
@echo "usage:"
@echo ""
@echo "* make view -- to see $(FILEPLAIN)"
@echo "* make edit -- to edit $(FILEPLAIN)"
@echo "* make portlinux -- to install dot files on a Linux machine"
@echo "* make portmac -- to install dot files on a Mac machine"
@echo "* make brewexport -- to export brew installs on Mac machine"
@echo "* make brewimport -- to import brew install onto a Mac machine"
@echo "* make help -- to see usage of the dotfile_install functions"
@echo ""
edit:
@umask $(UMASK);\
$(GPG) --output $(FILEPLAIN) --decrypt $(FILECRYPT)
@$(VI) $(FILEPLAIN)
@umask $(UMASK);\
$(GPG) --encrypt --recipient $(GPGID) $(FILEPLAIN)
@$(RM) $(FILEPLAIN)
view:
@umask $(UMASK); $(GPG) --decrypt $(FILECRYPT) | less
help:
@$(DOTFILE_HELP)
portlinux:
@$(LINUX_INSTALL)
portmac:
@$(MAC_INSTALL)
brewexport:
@$(CP) $(BREWFILE) $(BREWFILEBAK)
@$(RM) $(BREWFILE)
@$(BREW) bundle dump --file=$(BREWFILE);
brewimport:
@$(BREW) bundle install --file=$(BREWFILE);