[macOS] Use Brewfiles

This commit is contained in:
2016-10-08 22:18:26 -07:00
parent 14b484b2ab
commit b392fd30a3
9 changed files with 251 additions and 43 deletions

View File

@@ -8,7 +8,7 @@ from . import util
@ctask(default=True)
def setup(ctx):
brew(ctx)
cider(ctx)
brew_essential(ctx)
access_for_assistive_devices(ctx)
tccutil(ctx)
karabiner(ctx)
@@ -20,18 +20,10 @@ def setup(ctx):
iTerm(ctx)
keyboard_settings(ctx)
custom_keyboard_shortcuts(ctx)
brew_additional(ctx)
brew_default(ctx)
@ctask
def macvim(ctx):
macvim_install = (
"macvim --override-system-vim --custom-system-icons "
"--with-features=huge --enable-rubyinterp --enable-pythoninterp "
"--enable-perlinterp --enable-cscope"
)
ctx.run("brew install {0}".format(macvim_install))
ctx.run("vim +BundleInstall! +q +q")
@ctask
def setup_dbus(ctx):
@@ -45,6 +37,23 @@ def system_settings(ctx):
), pty=True)
BREWFILE_DIRECTORY = os.path.join(util.TASKS_DIRECTORY, "brewfiles")
def make_brewfile_task(filename):
task_name = "brew_{}".format(filename)
@ctask(name=task_name)
def temp(ctx):
ctx.run('brew bundle --file="{}"'.format(
os.path.join(BREWFILE_DIRECTORY, filename)
))
globals()[task_name] = temp
for filename in os.listdir(BREWFILE_DIRECTORY):
make_brewfile_task(filename)
@ctask
def cider(ctx):
ctx.run('brew install caskroom/cask/brew-cask')
@@ -58,6 +67,7 @@ def brew(ctx):
path = 'https://raw.githubusercontent.com/Homebrew/install/master/install)'
if not util.command_exists('brew'):
ctx.run('ruby -e "$(curl -fsSL {0}'.format(path))
ctx.run('brew tap Homebrew/bundle')
@ctask