-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.rb
110 lines (97 loc) · 1.97 KB
/
setup.rb
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
class Package < Struct.new(:command, :name, :opts)
def install!
if not_installed?
system("#{command} install #{name} #{opts.join(" ")}")
end
end
def not_installed?
!exists?
end
def exists?
system("#{command} info | grep #{name}")
end
end
def Bin(name, opts = [])
Package.new("brew", name, opts)
end
def App(name, opts = [])
Package.new("brew cask", name, opts)
end
def Node(name, opts = [])
Package.new("npm -g", name, opts)
end
def Atom(name, opts = [])
Package.new("apm", name, opts)
end
class Set < Struct.new(:name, :items); end
APPS = Set.new("Apps", [
App("google-chrome"),
App("firefox"),
App("1password"),
App("elm-platform"),
App("macdown"),
App("atom"),
App("visual-studio-code"),
App("slack"),
App("dropbox"),
App("kap"),
App("sip"),
App("toggl"),
App("virtual-box"),
App("iterm2")
])
BINS = Set.new("Programs, [
Bin(:openssl),
Bin(:git, ["--with-brewed-openssl"]),
Bin(:node, ["--with-openssl"]),
Bin(:phantomjs),
Bin(:rust),
Bin(:sqlite),
Bin(:postgresql),
Bin(:tmux),
Bin(:tree),
Bin(:ack),
Bin(:elixir),
Bin(:ffmpeg),
Bin(:hub),
Bin(:zsh),
Bin(:zsh-completions),
Bin(:gpg),
Bin(:heroku),
Bin(:vim, [
"--HEAD",
"--with-custom-ruby",
"--with-python3",
"--with-lua",
"--with-client-server"
])
])
PACKAGES = Set.new("Packages", [
Node("create-elm-app"),
Node("elm-format"),
Node("jest"),
Node("react"),
Node("prettier"),
Node("eslint"),
Atom("atom-beautify"),
Atom("atom-elixir"),
Atom("atom-elixir-formatter"),
Atom("cucumber"),
Atom("elm-format"),
Atom("elmjutsu"),
Atom("hyperclick"),
Atom("intentions"),
Atom("language-elixir"),
Atom("language-elm"),
Atom("language-slim"),
Atom("linter"),
Atom("linter-ui-default"),
Atom("prettier-atom"),
Atom("react"),
Atom("teletype"),
Atom("vim-mode-plus")
])
[BINS, APPS, PACKAGES].each do |set|
puts " == Now installing #{set.name} ==="
set.items.each(&:install!)
end