Skip to content

Instantly share code, notes, and snippets.

@manhg
Created September 13, 2014 06:55
Show Gist options
  • Save manhg/24858dd67a1b850c8c5e to your computer and use it in GitHub Desktop.
Save manhg/24858dd67a1b850c8c5e to your computer and use it in GitHub Desktop.
// Run after file saved
//
// Install Sass: sudo gem install sass
// Install CoffeeScript: npm install -g coffee-script
komodo.assertMacroVersion(3);
var koDoc = ko.views.manager.currentView.koDoc;
var input = koDoc.file.dirName + '/' + koDoc.file.baseName;
var barename = input.substr(0, input.length - koDoc.file.ext.length);
switch (koDoc.file.ext) {
case '.sass':
var output = barename + '.css';
ko.run.runEncodedCommand(window, 'sass --no-cache ' + input + ' ' + output);
break;
case '.coffee':
ko.run.runEncodedCommand(window, 'coffee --map --compile ' + input);
break;
default:
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment