Last active
May 3, 2017 00:56
-
-
Save jah2488/59f56f3bd7e02cb2481e43b0d1e7affd to your computer and use it in GitHub Desktop.
A setup script for a new laptop. (Assumes you have homebrew and homebrew cask installed)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
APPS = [ | |
App("hyper"), | |
App("google-chrome"), | |
App("1password"), | |
App("elm-platform"), | |
App("macdown"), | |
App("atom"), | |
App("slack"), | |
App("dropbox"), | |
App("kap"), | |
App("sip") | |
] | |
BINS = [ | |
Bin(:openssl), | |
Bin(:git, ["--with-brewed-openssl"]), | |
Bin(:node, ["--with-openssl"]), | |
Bin(:phantomjs), | |
Bin(:rust), | |
Bin(:sqlite), | |
Bin(:tmux), | |
Bin(:tree), | |
Bin(:ack), | |
Bin(:elixir), | |
Bin(:ffmpeg), | |
Bin(:hub), | |
Bin(:heroku), | |
Bin(:vim, [ | |
"--HEAD", | |
"--with-custom-ruby", | |
"--with-python3", | |
"--with-lua", | |
"--with-client-server" | |
]) | |
] | |
BINS.each(&:install!) | |
APPS.each(&:install!) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment