Skip to content

Instantly share code, notes, and snippets.

@Unitech
Created July 5, 2014 15:09
Show Gist options
  • Save Unitech/fdc9c36d96ce64ab494f to your computer and use it in GitHub Desktop.
Save Unitech/fdc9c36d96ce64ab494f to your computer and use it in GitHub Desktop.
List grunt task and exec
var grunt = require('grunt');
var gruntfile = require('./Gruntfile.js')(grunt);
var tasks = grunt.task._tasks;
var tasks_array = [];
for (var task in tasks) {
if (tasks.hasOwnProperty(task)) {
console.log(tasks[task].name);
tasks_array.push(tasks[task].name);
}
}
/*grunt.util.spawn({
grunt: true,
args: ['dist']
}, function(err, res, code) {
console.log(arguments);
});*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment