Skip to content
Myr

refactored express(1) stdin usage

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 8c229a8 · Browse files · 1 file+4 added−13 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−13 removed

  • other:+4 added−13 removed

1 file+4 added−13 removed

modified:bin/express+4 added-13 removed
12 unmodified lines
1314var version = '2.0.0-pre';1516/**17 * stdin stream.18 */1920var stdin;2122/**17 * Add session support.18 */1920var sessions = false;
250 unmodified lines
271 createApplicationAt(path);272 } else {273 confirm('destination is not empty, continue? ', function(ok){274 if (ok) {281 stdin.destroy();275 process.stdin.destroy();276 createApplicationAt(path);277 } else {278 abort('aborting');279 }
128 unmodified lines
408 * @param {Function} fn409 */410411function prompt(msg, fn) {418 stdin = stdin || process.openStdin();419412 // prompt413 if (' ' == msg[msg.length - 1]) {414 process.stdout.write(msg);415 } else {416 console.log(msg);417 }418419 // stdin428 stdin.setEncoding('ascii');429 stdin.addListener('data', function(data){420 process.stdin.setEncoding('ascii');421 process.stdin.once('data', function(data){422 fn(data);431 stdin.removeListener('data', arguments.callee);432 });423 }).resume();424}425426/**427 * Mkdir -p.
23 unmodified lines