diff --git a/lib/base-package-manager.ts b/lib/base-package-manager.ts index 22d6c6d620..12b24df7d1 100644 --- a/lib/base-package-manager.ts +++ b/lib/base-package-manager.ts @@ -111,6 +111,7 @@ export abstract class BasePackageManager implements INodePackageManager { await this.$childProcess.spawnFromEvent(npmExecutable, params, "close", { cwd: opts.cwd, stdio: stdioValue, + shell: this.$hostInfo.isWindows, }); // Whenever calling "npm install" or "yarn add" without any arguments (hence installing all dependencies) no output is emitted on stdout diff --git a/lib/commands/typings.ts b/lib/commands/typings.ts index 851ce5ebf4..6856a28378 100644 --- a/lib/commands/typings.ts +++ b/lib/commands/typings.ts @@ -173,7 +173,7 @@ export class TypingsCommand implements ICommand { this.$hostInfo.isWindows ? "ns.cmd" : "ns", ["prepare", "android"], "exit", - { stdio: "inherit" } + { stdio: "inherit", shell: this.$hostInfo.isWindows } ); } diff --git a/lib/common/mobile/android/android-virtual-device-service.ts b/lib/common/mobile/android/android-virtual-device-service.ts index 1dcba19b02..ade98318dc 100644 --- a/lib/common/mobile/android/android-virtual-device-service.ts +++ b/lib/common/mobile/android/android-virtual-device-service.ts @@ -22,7 +22,8 @@ import { import { injector } from "../../yok"; export class AndroidVirtualDeviceService - implements Mobile.IAndroidVirtualDeviceService { + implements Mobile.IAndroidVirtualDeviceService +{ private androidHome: string; private mapEmulatorIdToImageIdentifier: IStringDictionary = {}; @@ -211,7 +212,8 @@ export class AndroidVirtualDeviceService let result: ISpawnResult = null; let devices: Mobile.IDeviceInfo[] = []; let errors: string[] = []; - const canExecuteAvdManagerCommand = await this.canExecuteAvdManagerCommand(); + const canExecuteAvdManagerCommand = + await this.canExecuteAvdManagerCommand(); if (!canExecuteAvdManagerCommand) { errors = [ "Unable to execute avdmanager, ensure JAVA_HOME is set and points to correct directory", @@ -221,7 +223,8 @@ export class AndroidVirtualDeviceService if (canExecuteAvdManagerCommand) { result = await this.$childProcess.trySpawnFromCloseEvent( this.pathToAvdManagerExecutable, - ["list", "avds"] + ["list", "avds"], + { shell: this.$hostInfo.isWindows } ); } else if ( this.pathToAndroidExecutable && @@ -403,9 +406,8 @@ export class AndroidVirtualDeviceService private getAvdManagerDeviceInfo( output: string ): Mobile.IAvdManagerDeviceInfo { - const avdManagerDeviceInfo: Mobile.IAvdManagerDeviceInfo = Object.create( - null - ); + const avdManagerDeviceInfo: Mobile.IAvdManagerDeviceInfo = + Object.create(null); // Split by `\n`, not EOL as the avdmanager and android executables print results with `\n` only even on Windows _.reduce( @@ -437,9 +439,8 @@ export class AndroidVirtualDeviceService avdFilePath, AndroidVirtualDevice.CONFIG_INI_FILE_NAME ); - const configIniFileInfo = this.$androidIniFileParser.parseIniFile( - configIniFilePath - ); + const configIniFileInfo = + this.$androidIniFileParser.parseIniFile(configIniFilePath); const iniFilePath = this.getIniFilePath(configIniFileInfo, avdFilePath); const iniFileInfo = this.$androidIniFileParser.parseIniFile(iniFilePath); diff --git a/lib/services/android-plugin-build-service.ts b/lib/services/android-plugin-build-service.ts index 0ba08ec83c..84757adbd1 100644 --- a/lib/services/android-plugin-build-service.ts +++ b/lib/services/android-plugin-build-service.ts @@ -815,6 +815,7 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService { await this.$childProcess.spawnFromEvent(gradlew, localArgs, "close", { cwd: pluginBuildSettings.pluginDir, stdio: "inherit", + shell: this.$hostInfo.isWindows, }); } catch (err) { this.$errors.fail( diff --git a/lib/services/android/gradle-command-service.ts b/lib/services/android/gradle-command-service.ts index 3295433d22..3e6c3e3117 100644 --- a/lib/services/android/gradle-command-service.ts +++ b/lib/services/android/gradle-command-service.ts @@ -26,7 +26,11 @@ export class GradleCommandService implements IGradleCommandService { const { message, cwd, stdio, spawnOptions } = options; this.$logger.info(message); - const childProcessOptions = { cwd, stdio: stdio || "inherit" }; + const childProcessOptions = { + cwd, + stdio: stdio || "inherit", + shell: this.$hostInfo.isWindows, + }; const gradleExecutable = options.gradlePath ?? (this.$hostInfo.isWindows ? "gradlew.bat" : "./gradlew"); @@ -44,7 +48,7 @@ export class GradleCommandService implements IGradleCommandService { private async executeCommandSafe( gradleExecutable: string, gradleArgs: string[], - childProcessOptions: { cwd: string; stdio: string }, + childProcessOptions: { cwd: string; stdio: string; shell: boolean }, spawnOptions: ISpawnFromEventOptions ): Promise { try {