You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

30 lines
765 B

/*
* grunt-contrib-watch
* http://gruntjs.com/
*
* Copyright (c) 2013 "Cowboy" Ben Alman, contributors
* Licensed under the MIT license.
*/
module.exports = function(grunt) {
'use strict';
grunt.registerMultiTask('echo', 'A task that echos a message.', function() {
var msg = this.data.message || 'I do absolutely nothing.';
var wait = this.data.wait || grunt.option('wait') || 0;
var fail = this.data.fail || false;
var done = this.async();
// After a given time print a message or fail
setTimeout(function() {
if (fail) {
grunt.fail.fatal(msg, fail);
} else {
grunt.log.writeln(msg);
done();
}
}, wait);
// Keep the process alive
setInterval(function() {}, 250);
});
};