Skip to content

Commit 133259f

Browse files
committed
fix(init): Fixed issue with buffer filling up and pausing child_process until its emptied
Now we always create a readline interface and clear out the pipe regardless of —verbose mode
1 parent 8a7b10d commit 133259f

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

bin/clever-init

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -115,23 +115,20 @@ function installNPMPackages(projectDir) {
115115
var args = ['install']
116116
, opts = { env: process.env, cwd: projectDir };
117117

118-
if (!program.verbose) {
119-
args.push('--silent');
120-
}
121-
122118
var proc = spawn(!isWin ? 'npm' : 'npm.cmd', args, opts)
123119
, error = '';
124-
125-
if (!!program.verbose) {
126-
readline
127-
.createInterface({
128-
input : proc.stdout,
129-
terminal : false
130-
})
131-
.on('line', function(line) {
120+
121+
// Create a readline interface because otherwise the buffer will
122+
readline
123+
.createInterface({
124+
input : proc.stdout,
125+
terminal : false
126+
})
127+
.on('line', function(line) {
128+
if (!!program.verbose) {
132129
console.log(' ' + line);
133-
});
134-
}
130+
}
131+
});
135132

136133
proc.on('error', function(err) {
137134
error += err;
@@ -176,7 +173,7 @@ function setupBackend() {
176173
}
177174

178175
utils
179-
.info('Downloading and extracting ' + csPackage.name + '...')
176+
.info(' Downloading and extracting ' + csPackage.name + '...')
180177
.running('Downloading and extracting ' + csPackage.name + '...');
181178

182179
lib.packages

0 commit comments

Comments
 (0)