Commit f9122164 by PeterHatch Committed by Michael Mifsud

In watch mode, play an audible cue when there is an error. (#1578)

* In watch mode, play an audible cue when there is an error.

* Added error-bell option.

* Added error-bell option to documentation.
parent f2f481b5
......@@ -504,6 +504,7 @@ Example:
--include-path Path to look for imported files
--follow Follow symlinked directories
--precision The amount of precision allowed in decimal numbers
--error-bell Output a bell character on errors
--importer Path to .js file containing custom importer
--functions Path to .js file containing custom functions
--help Print usage info
......
......@@ -53,14 +53,16 @@ var cli = meow({
' --include-path Path to look for imported files',
' --follow Follow symlinked directories',
' --precision The amount of precision allowed in decimal numbers',
' --error-bell Output a bell character on errors',
' --importer Path to .js file containing custom importer',
' --functions Path to .js file containing custom functions',
' --help Print usage info'
].join('\n')
}, {
boolean: [
'indented-syntax',
'error-bell',
'follow',
'indented-syntax',
'omit-source-map-url',
'quiet',
'recursive',
......@@ -143,6 +145,9 @@ function getEmitter() {
var emitter = new Emitter();
emitter.on('error', function(err) {
if (options.errorBell) {
err += '\x07';
}
console.error(err);
if (!options.watch) {
process.exit(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment