Created
February 7, 2018 01:55
-
-
Save jtsternberg/e624acb1ec81390fff1e01e1478363ec to your computer and use it in GitHub Desktop.
replace grunt-bell with a "say" command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* grunt-bell | |
* https://github.com/dragonworx/grunt-bell | |
* | |
* Copyright (c) 2013 Ali Chamas | |
* Licensed under the MIT license. | |
*/ | |
var start = process.hrtime(); | |
module.exports = function(grunt) { | |
// Please see the Grunt documentation for more information regarding task | |
// creation: http://gruntjs.com/creating-tasks | |
var exec = require('child_process').exec; | |
grunt.registerTask('bell', 'Ding-a-ling', function () { | |
var end = process.hrtime(start); | |
var secs = (end[0] + (end[1] / 1000000000.0)).toFixed(2); | |
var msg = 'ESC[92m ESC[0mESC[32m\nTasks completed ESC[0mESC[90m (' + secs + 's)ESC[0m'; | |
msg = msg.replace(/ESC/gi, '\033'); | |
console.log(msg /*+ '\u0007'*/); | |
exec( 'say "build complete" -r 280 -v Boing'); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment