diff --git a/lib/index.js b/lib/index.js index c2866a0..d30e5df 100644 --- a/lib/index.js +++ b/lib/index.js @@ -32,8 +32,9 @@ const DEFAULT_WRITE_LEVEL = 'INFO'; */ class UI { constructor(_options) { - let spinner = this.spinner = ora({ color: 'green' }); let options = _options || {}; + let errorStream = this.errorStream = options.errorStream || process.stderr; + let spinner = this.spinner = ora({ color: 'green', stream: errorStream }); // Output stream this.progress = false; this.actualOutputStream = options.outputStream || process.stdout; @@ -51,7 +52,6 @@ class UI { this.outputStream.setMaxListeners(0); this.outputStream.pipe(this.actualOutputStream); this.inputStream = options.inputStream || process.stdin; - this.errorStream = options.errorStream || process.stderr; this.errorLog = options.errorLog || []; this.writeLevel = options.writeLevel || DEFAULT_WRITE_LEVEL; this.errorReport = null;