Last active
November 17, 2015 15:49
-
-
Save idleberg/df8f04ec04d2b523d5ff to your computer and use it in GitHub Desktop.
Install Brew dependencies for Sublime Packages, e.g. linters
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
# https://gist.github.com/idleberg/df8f04ec04d2b523d5ff | |
import os, sublime, sublime_plugin, subprocess | |
# Array of required Brew packages | |
packages = [ | |
'' | |
] | |
def plugin_loaded(): | |
from package_control import events | |
from subprocess import check_call | |
# Get name of package folder | |
me = os.path.basename(os.path.dirname(os.path.realpath(__file__))) | |
pkg_dir = sublime.packages_path() + '/' + me | |
if len(packages) > 0: | |
for pkg in packages: | |
if pkg: | |
print("[%s] brew install %s" % ( me, pkg)) | |
os.chdir(pkg_dir) | |
check_call(['brew', 'install', pkg]) | |
else: | |
print("[%s] No package specified" % me) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment