File tree 3 files changed +26
-32
lines changed
3 files changed +26
-32
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ var path = require('path'),
5
5
fs = require ( 'fs' ) ,
6
6
util = require ( 'util' ) ,
7
7
wildcard = require ( '../lib/utils/wildcard' ) . wildcard ,
8
- NullStream = require ( '../lib/utils/nullstream ' ) . NullStream ,
8
+ NopStream = require ( '../lib/utils/nopstream ' ) . NopStream ,
9
9
events = require ( 'events' ) ;
10
10
11
11
//
@@ -192,7 +192,7 @@ if (options.supressStdout) {
192
192
var devNullStream = null ;
193
193
194
194
if ( process . platform === 'win32' ) {
195
- devNullStream = new NullStream ( ) ;
195
+ devNullStream = new NopStream ( ) ;
196
196
} else {
197
197
devNullStream = fs . createWriteStream ( '/dev/null' ) ;
198
198
}
Original file line number Diff line number Diff line change
1
+ // NopStream
2
+ // a writeable stream to mimic writing to /dev/null on windows
3
+ // from https://gist.github.com/3221453
4
+
5
+ // Set both readable and writable in constructor.
6
+ var NopStream = exports . NopStream = function ( ) {
7
+ this . readable = true ;
8
+ this . writable = true ;
9
+ } ;
10
+
11
+ // Inherit from base stream class.
12
+ require ( 'util' ) . inherits ( NopStream , require ( 'stream' ) ) ;
13
+
14
+ // Extract args to `write` and emit as `data` event.
15
+ NopStream . prototype . write = function ( ) {
16
+ args = Array . prototype . slice . call ( arguments , 0 ) ;
17
+ this . emit . apply ( this , [ 'data' ] . concat ( args ) )
18
+ } ;
19
+
20
+ // Extract args to `end` and emit as `end` event.
21
+ NopStream . prototype . end = function ( ) {
22
+ args = Array . prototype . slice . call ( arguments , 0 ) ;
23
+ this . emit . apply ( this , [ 'end' ] . concat ( args ) )
24
+ } ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments