javascript - Grunt-init template execute shell command -
is there way execute shell command when creating grunt-init scaffolding template? example execute "bower install" , "git init" after project created without having enter commands afterwards. api not seem include functionality.
the template.js
executed node, can use node has offer you.
i've managed child_process.exec
:
var exec = require("child_process").exec; ... exec("bower install", function(error, stdout, stderr) { if (error !== null) { console.log("error: " + error); } done(); });
the "problem" see don't have logs bower, if installing many components, may take while before other visual feedback.
Comments
Post a Comment