Skip to content

Instantly share code, notes, and snippets.

@idleberg
Last active November 17, 2015 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idleberg/df8f04ec04d2b523d5ff to your computer and use it in GitHub Desktop.
Save idleberg/df8f04ec04d2b523d5ff to your computer and use it in GitHub Desktop.
Install Brew dependencies for Sublime Packages, e.g. linters
# 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