Skip to content

Instantly share code, notes, and snippets.

@mduvall
Last active December 14, 2015 06:49
Show Gist options
  • Save mduvall/5045753 to your computer and use it in GitHub Desktop.
Save mduvall/5045753 to your computer and use it in GitHub Desktop.
Sublime thing for grunting on save
import sublime, sublime_plugin
import os
import tempfile
class HandlebarsOnSave(sublime_plugin.EventListener):
def on_post_save(self, view):
folder_name, file_name = os.path.split(view.file_name())
extension = file_name[-3:]
if extension == 'hbs':
view.window().run_command('exec', { 'cmd': 'export PATH=/usr/local/bin:$PATH; /usr/local/share/npm/bin/grunt', 'shell': True, 'quiet': True})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment