Closed betaorbust closed 6 years ago
@betaorbust Thank you for the report.
This cause is in mute-stdout
as you pointed, and I sended a pr to it to fix this issue.
I've just published 1.0.1 of mute-stdout with @sttk's fix. Please update your dependencies (and make sure it's not locked to 1.0.0 in your lockfile) and try again.
Description
If you make any modifications to
process.stdout.write
within agulpfile
they will be immediately undone before the tasks are executed.Technical Description
The root cause seems to be that
mute-stdout
's unmute is called every time, no matter what, https://github.com/gulpjs/gulp-cli/blob/1b801881aa8c12fc1c74fb76ff6f297561e6f283/lib/versioned/%5E4.0.0/index.js#L40-L41 https://github.com/gulpjs/gulp-cli/blob/1b801881aa8c12fc1c74fb76ff6f297561e6f283/lib/versioned/%5E3.7.0/index.js#L33-L34 andmute-stdout
replaces process.stdout.write even when mute-stdout'smute
hasn't been called. https://github.com/js-cli/mute-stdout/blob/acf7a79299c01bd5a43c6e1ce25fead75c956838/index.js#L3-L18This means that anything you do inside a gulpfile that modifies process.stdout.write is blown away once the gulpfile has run.
Repo Case
Which currently results in: So,
Hide me 1
andHide me 2
are processed correctly, but then between the gulpfile run and the task run,stdout.write
is overwritten, andHide me 2
/Show me 2
are not captured.