Skip to content

Instantly share code, notes, and snippets.

@jtsternberg
Created February 7, 2018 01:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtsternberg/e624acb1ec81390fff1e01e1478363ec to your computer and use it in GitHub Desktop.
Save jtsternberg/e624acb1ec81390fff1e01e1478363ec to your computer and use it in GitHub Desktop.
replace grunt-bell with a "say" command
/*
* 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