after-brunch
Version:
A micro-plugin to run commands line scripts after Brunch's compile.
39 lines (31 loc) • 897 B
JavaScript
// Generated by CoffeeScript 1.7.1
var AfterBrunch, exec, sysPath;
sysPath = require('path');
exec = require('child_process').exec;
module.exports = AfterBrunch = (function() {
AfterBrunch.prototype.brunchPlugin = true;
function AfterBrunch(config) {
var _ref;
this.config = config;
this.commands = (_ref = this.config.plugins.afterBrunch) != null ? _ref : [];
}
AfterBrunch.prototype.onCompile = function(generatedFiles) {
var command, _i, _len, _ref;
_ref = this.commands;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
command = _ref[_i];
exec(command, function(error, stdout, stderr) {
if (stdout) {
console.log(stdout);
}
if (error) {
console.log(error.message);
}
if (stderr) {
return console.log(stderr);
}
});
}
};
return AfterBrunch;
})();