Merge pull request #6588 from Microsoft/tyriar/bin_verbose_fix

Have --verbose work on the bin command
This commit is contained in:
Benjamin Pasero
2016-05-25 11:41:01 +02:00
2 changed files with 17 additions and 7 deletions
+1
View File
@@ -94,6 +94,7 @@ ${ indent }-r, --reuse-window Force opening a file or folder in the last acti
${ indent } window.
${ indent }--user-data-dir <dir> Specifies the directory that user data is kept in,
${ indent } useful when running as root.
${ indent }--verbose Print verbose output (implies --wait).
${ indent }-v, --version Print version.
${ indent }-w, --wait Wait for the window to be closed before returning.
${ indent }--list-extensions List the installed extensions.
+16 -7
View File
@@ -35,14 +35,23 @@ export function main(args: string[]): TPromise<void> {
});
delete env['ATOM_SHELL_INTERNAL_RUN_AS_NODE'];
const child = spawn(process.execPath, args, {
detached: true,
stdio: 'ignore',
env
});
let options = {
detacted: true,
env,
};
if (!argv.verbose) {
options['stdio'] = 'ignore';
}
if (argv.wait) {
return new TPromise<void>(c => child.once('exit', ()=> c(null)));
const child = spawn(process.execPath, args, options);
if (argv.verbose) {
child.stdout.on('data', (data) => console.log(data.toString('utf8').trim()));
child.stderr.on('data', (data) => console.log(data.toString('utf8').trim()));
}
if (argv.wait || argv.verbose) {
return new TPromise<void>(c => child.once('exit', () => c(null)));
}
}