-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
68 lines (59 loc) · 1.68 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
61
62
63
64
65
66
67
68
.SECONDEXPANSION:
.SHELLFLAGS = -euo pipefail
rbenv_root = /opt/rbenv
nodenv_root = /opt/nodenv
rbenv_plugindir = $(rbenv_root)/plugins
nodenv_plugindir = $(nodenv_root)/plugins
rbenv_plugins = $(addprefix $(rbenv_plugindir)/,\
tpope/rbenv-aliases \
ianheggie/rbenv-binstubs \
aripollak/rbenv-bundler-ruby-version \
tpope/rbenv-ctags \
sstephenson/rbenv-default-gems \
chriseppstein/rbenv-each \
ianheggie/rbenv-env \
mlafeldt/rbenv-man \
rkh/rbenv-update \
jasonkarns/ruby-build-update-defs)
nodenv_plugins = $(addprefix $(nodenv_plugindir)/nodenv/,\
node-build-update-defs \
nodenv-aliases \
nodenv-default-packages \
nodenv-each \
nodenv-man \
nodenv-package-json-engine \
nodenv-package-rehash \
nodenv-update)
all: | rbenv nodenv vim npm gpg
rbenv: $(rbenv_plugins)
@echo '==> Updating rbenv…'
rbenv update
brew rbenv-sync
rbenv alias --auto
rbenv alias brew `brew ruby -e 'puts RUBY_BIN.dirname'`
rbenv rehash
nodenv: $(nodenv_plugins)
@echo '==> Updating nodenv…'
nodenv update
brew nodenv-sync
nodenv alias --auto
nodenv rehash
vim:
@echo '==> Setting up vim…'
vim +PluginUpdate +PluginClean +qall
npm:
@echo '==> Updating npm…'
NODENV_VERSION=system npm update -g
gpg:
@if command -v keybase; then echo '==> Updating keybase/gpg…'; \
keybase pgp pull; fi
prefs:
dotfiles/prefs
$(rbenv_root) $(nodenv_root):
sudo install -o "${USER}" -g staff -d $@
%/plugins: | $$(@D)
install -o "${USER}" -g staff -d $@
$(rbenv_plugins): $(rbenv_plugindir)/%: | $$(@:/%=)
@[ -d $|/$(@F) ] || git -C $| clone https://github.com/$*.git
$(nodenv_plugins): $(nodenv_plugindir)/%: | $$(@:/%=)
@[ -d $|/$(@F) ] || git -C $| clone https://github.com/$*.git