Skip to content

Instantly share code, notes, and snippets.

@yields
Last active December 12, 2015 02:39
Show Gist options
  • Save yields/4700806 to your computer and use it in GitHub Desktop.
Save yields/4700806 to your computer and use it in GitHub Desktop.
quick plugin for st3 to build components on save.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
import sublime, sublime_plugin
from subprocess import call
import os
class MakeComponents(sublime_plugin.EventListener):
def on_post_save_async(self, view):
win = view.window()
path = win.folders()[0]
cmd = 'make --directory=' + path
json = os.path.exists(path + '/component.json')
json and call(cmd, shell=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment