Created
March 20, 2015 08:53
-
-
Save codegirl-007/c4f684cf793bb94d49d1 to your computer and use it in GitHub Desktop.
Simple Node Watcher
This file contains hidden or 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
// Require | |
var watchr = require('watchr'); | |
var exec = require('child_process').exec; | |
watchr.watch({ | |
paths: ['js', 'css', 'templates'], | |
listeners: { | |
error: function (err) { | |
console.log('an error occured:', err); | |
}, change: function () { | |
exec('make build', function (error) { | |
console.log(">>> built"); | |
if (error !== null) { | |
console.log('exec error: ' + error); | |
} | |
}); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment