Created
March 27, 2012 15:10
-
-
Save juice49/2216739 to your computer and use it in GitHub Desktop.
Recompiles CSS files when source stylus files are saved
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
var | |
fs = require('fs'), | |
exec = require('child_process').exec, | |
stylus = require('stylus'); | |
var generateCSS = function() { | |
exec('stylus ./ --out ../../css/ --use nib/lib/nib', function(err, stdout, stderr) { | |
if(err) { | |
console.log(err); | |
} | |
if(stdout) { | |
console.log(stdout); | |
} | |
if(stderr) { | |
console.log(stderr); | |
} | |
}); | |
} | |
fs.watch('./', generateCSS); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment