How to use the task function from grunt
Find comprehensive JavaScript grunt.task code examples handpicked from public code repositorys.
38 39 40 41 42 43 44 45 46 47
grunt.registerTask('done', 'done', function () { tasksDone = true; }); grunt.task.run(['create-windows-installer', 'done']).start(); waitsFor(30000, function () { return tasksDone; });
GitHub: gruntjs/grunt-init

32 33 34 35 36 37 38 39 40 41
} }); // Hook into grunt.task.init to load the built-in init task. hooker.hook(grunt.task, 'init', function() { grunt.task.loadTasks(asset('tasks')); }); var name; if (grunt.cli.tasks.length === 0) {
+ 5 other calls in file
GitHub: maxov/gulp-grunt

47 48 49 50 51 52 53 54 55 56
grunt.task.init([]); process.chdir(oldCwd); var gruntTasks = grunt.task._tasks, finalTasks = {}; var registerGruntTask = function (name) { finalTasks[opt.prefix + name] = function (cb) {
+ 3 other calls in file
GitHub: yapplabs/glazier

80 81 82 83 84 85 86 87 88 89
updateChanges(changes); } function copyCards(value){ grunt.task.run('copy:cards'); return value; } function buildCard(card) {
+ 3 other calls in file
GitHub: spmjs/spm-init

52 53 54 55 56 57 58 59 60 61
/* run grunt init task */ function runTask() { grunt.task.loadTasks(path.join(__dirname, '../node_modules/grunt-init/tasks')); // fix windows directory by replace C:\ to C\:\ var taskName = 'init:' + template.replace(/^([a-zA-Z]):\\/, '$1\\:\\'); grunt.cli.tasks = [taskName]; grunt.cli({});
GitHub: eclifford/towelie

64 65 66 67 68 69 70 71 72
// } function displayTasks(name, tasksList) { var tasks = tasksList.map(function(name) { col1len = Math.max(col1len, name.length); var info = grunt.task._tasks[name].info; return [name, info.blue]; });
+ 3 other calls in file
78 79 80 81 82 83 84 85 86 87
index.registerTasks(this.settings, grunt); }); it('should register local tasks', function() { grunt.task.exists('foo1').should.be.ok; grunt.task.exists('foo2').should.be.ok; }); it('should append tasks to settings config', function() { this.settings.config.copy.should.have.properties('foo1', 'foo2');
+ 35 other calls in file
GitHub: phated/grunt-enyo

91 92 93 94 95 96 97 98 99
}; }); var tasks = map(enyoTasks, grunt.task._tasks); var inits = map(enyoInits, initDefs); var bowers = map(enyoBowers, grunt.task._tasks); var opts = map(enyoOptions, grunt.cli.optlist, true); function displayTasks(header, tasks) {
+ 7 other calls in file
87 88 89 90 91 92 93 94 95 96
}); }); describe('#registerTasks', function() { after(function() { grunt.task.renameTask('foo1', 'foo1#task.registerTasks'); }); it('should register all grunt tasks', function() { grunt.task.exists('foo1').should.not.be.ok;
+ 5 other calls in file
77 78 79 80 81 82 83 84 85 86
process.send({ fail: 'fatal', error: errorToObject(e), errcode: errcode }); grunt.task.clearQueue(); grunt.util.exit(typeof errcode === 'number' ? errcode : grunt.fail.code.FATAL_ERROR); }; grunt.fail.warn = function (e, errcode) {
+ 9 other calls in file
GitHub: unumux/gruntfile-utils

4 5 6 7 8 9 10 11 12
var Stream = require('stream'); module.exports = { getTasks: function(filename, taskArray) { var oldGruntRegisterTask = grunt.task.registerTask; var origDir = process.cwd(); process.chdir(path.dirname(filename)); var gruntfile = require(filename);
+ 3 other calls in file
20 21 22 23 24 25 26 27 28 29
grunt.fail.warn("Invalid target specified. Did you pass the wrong argument? Please check your task configuration.", 6); } console.log("pulling site from " + target); // Pull database grunt.task.run('pull_db'); // Pulls WordPress files. Also pulls wp-content files if no repo is specified grunt.task.run('pull_files'); if (git_repo) { grunt.task.run('sshexec:git_status');
+ 5 other calls in file
grunt.file is the most popular function in grunt (372 examples)