From 08c0531ee52a8a99e1ca14891d0c6561c18a4cf6 Mon Sep 17 00:00:00 2001 From: Chris Abernethy Date: Sat, 21 Sep 2019 14:22:25 -0400 Subject: [PATCH 1/4] Suppress verbose compiler output in run::runBuildDeploy() unless --verbose is specified --- packages/ionic/src/commands/cordova/run.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/ionic/src/commands/cordova/run.ts b/packages/ionic/src/commands/cordova/run.ts index 366832f73f..04dd4bd77a 100644 --- a/packages/ionic/src/commands/cordova/run.ts +++ b/packages/ionic/src/commands/cordova/run.ts @@ -334,14 +334,19 @@ Just like with ${input('ionic cordova build')}, you can pass additional options } } + const buildOpts: IShellRunOptions = { }; + // ignore very verbose compiler output unless --verbose (still pipe stderr) + if (!options['verbose']) { + buildOpts.stdio = ['ignore', 'ignore', 'pipe']; + } + if (options['native-run']) { const [ platform ] = inputs; const packagePath = await getPackagePath(conf.getProjectInfo().name, platform, { emulator: !options['device'], release: !!options['release'] }); - - await this.runCordova(filterArgumentsForCordova({ ...metadata, name: 'build' }, options), { stdio: 'inherit' }); + await this.runCordova(filterArgumentsForCordova({ ...metadata, name: 'build' }, options), buildOpts); await this.runNativeRun(createNativeRunArgs({ packagePath, platform }, { ...options, connect: false })); } else { - await this.runCordova(filterArgumentsForCordova(metadata, options), { stdio: 'inherit' }); + await this.runCordova(filterArgumentsForCordova(metadata, options), buildOpts); } } From d51b1f25ff4f191c8561fcbd10d6608dc0682faa Mon Sep 17 00:00:00 2001 From: Chris Abernethy Date: Sat, 21 Sep 2019 14:32:42 -0400 Subject: [PATCH 2/4] Update verbosity suppression for run::runServeDeploy to include --no-native-run code path --- packages/ionic/src/commands/cordova/run.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/ionic/src/commands/cordova/run.ts b/packages/ionic/src/commands/cordova/run.ts index 04dd4bd77a..a7df6d6418 100644 --- a/packages/ionic/src/commands/cordova/run.ts +++ b/packages/ionic/src/commands/cordova/run.ts @@ -291,22 +291,21 @@ Just like with ${input('ionic cordova build')}, you can pass additional options await conf.save(); const cordovalogws = createPrefixedWriteStream(this.env.log, weak(`[cordova]`)); + const buildOpts: IShellRunOptions = { stream: cordovalogws }; + // ignore very verbose compiler output unless --verbose (still pipe stderr) + if (!options['verbose']) { + buildOpts.stdio = ['ignore', 'ignore', 'pipe']; + } if (options['native-run']) { const [ platform ] = inputs; const packagePath = await getPackagePath(conf.getProjectInfo().name, platform, { emulator: !options['device'], release: !!options['release'] }); const forwardedPorts = details ? runner.getUsedPorts(runnerOpts, details) : []; - const buildOpts: IShellRunOptions = { stream: cordovalogws }; - // ignore very verbose compiler output unless --verbose (still pipe stderr) - if (!options['verbose']) { - buildOpts.stdio = ['ignore', 'ignore', 'pipe']; - } - await this.runCordova(filterArgumentsForCordova({ ...metadata, name: 'build' }, options), buildOpts); await this.runNativeRun(createNativeRunArgs({ packagePath, platform, forwardedPorts }, options)); } else { - await this.runCordova(filterArgumentsForCordova(metadata, options), { stream: cordovalogws }); + await this.runCordova(filterArgumentsForCordova(metadata, options), buildOpts); await sleepForever(); } } From f49800be5a18ece1816fdace7a836eedfef3740a Mon Sep 17 00:00:00 2001 From: Chris Abernethy Date: Sat, 21 Sep 2019 15:06:24 -0400 Subject: [PATCH 3/4] Finalize stdio for runBuildDeploy and runServeDeploy Change stdin from ignore to pipe when not in verbose mode. Set stdio to 'inherit' in verbose mode --- packages/ionic/src/commands/cordova/run.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/ionic/src/commands/cordova/run.ts b/packages/ionic/src/commands/cordova/run.ts index a7df6d6418..c2449ffe40 100644 --- a/packages/ionic/src/commands/cordova/run.ts +++ b/packages/ionic/src/commands/cordova/run.ts @@ -292,10 +292,8 @@ Just like with ${input('ionic cordova build')}, you can pass additional options const cordovalogws = createPrefixedWriteStream(this.env.log, weak(`[cordova]`)); const buildOpts: IShellRunOptions = { stream: cordovalogws }; - // ignore very verbose compiler output unless --verbose (still pipe stderr) - if (!options['verbose']) { - buildOpts.stdio = ['ignore', 'ignore', 'pipe']; - } + // ignore very verbose compiler output on stdout unless --verbose + buildOpts.stdio = options['verbose'] ? 'inherit' : ['pipe', 'ignore', 'pipe']; if (options['native-run']) { const [ platform ] = inputs; @@ -334,10 +332,8 @@ Just like with ${input('ionic cordova build')}, you can pass additional options } const buildOpts: IShellRunOptions = { }; - // ignore very verbose compiler output unless --verbose (still pipe stderr) - if (!options['verbose']) { - buildOpts.stdio = ['ignore', 'ignore', 'pipe']; - } + // ignore very verbose compiler output on stdout unless --verbose + buildOpts.stdio = options['verbose'] ? 'inherit' : ['pipe', 'ignore', 'pipe']; if (options['native-run']) { const [ platform ] = inputs; From 2e8620be46afde8880d8571e0ad8d12df68f0418 Mon Sep 17 00:00:00 2001 From: Chris Abernethy Date: Tue, 1 Oct 2019 13:04:33 -0400 Subject: [PATCH 4/4] runBuildDeploy should always emit all output --- packages/ionic/src/commands/cordova/run.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/ionic/src/commands/cordova/run.ts b/packages/ionic/src/commands/cordova/run.ts index c2449ffe40..1fa406299e 100644 --- a/packages/ionic/src/commands/cordova/run.ts +++ b/packages/ionic/src/commands/cordova/run.ts @@ -331,17 +331,14 @@ Just like with ${input('ionic cordova build')}, you can pass additional options } } - const buildOpts: IShellRunOptions = { }; - // ignore very verbose compiler output on stdout unless --verbose - buildOpts.stdio = options['verbose'] ? 'inherit' : ['pipe', 'ignore', 'pipe']; - if (options['native-run']) { const [ platform ] = inputs; const packagePath = await getPackagePath(conf.getProjectInfo().name, platform, { emulator: !options['device'], release: !!options['release'] }); - await this.runCordova(filterArgumentsForCordova({ ...metadata, name: 'build' }, options), buildOpts); + + await this.runCordova(filterArgumentsForCordova({ ...metadata, name: 'build' }, options), { stdio: 'inherit' }); await this.runNativeRun(createNativeRunArgs({ packagePath, platform }, { ...options, connect: false })); } else { - await this.runCordova(filterArgumentsForCordova(metadata, options), buildOpts); + await this.runCordova(filterArgumentsForCordova(metadata, options), { stdio: 'inherit' }); } }