From 31db079b086ccc32595b1c2327d6c6906402befc Mon Sep 17 00:00:00 2001 From: Pierce Thompson Date: Wed, 9 Aug 2023 17:16:15 -0400 Subject: [PATCH] Fix process command/args --- src/main/services/bs-installer.service.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/services/bs-installer.service.ts b/src/main/services/bs-installer.service.ts index 528ae649..162497d4 100644 --- a/src/main/services/bs-installer.service.ts +++ b/src/main/services/bs-installer.service.ts @@ -47,7 +47,9 @@ export class BSInstallerService { public async isDotNet6Installed(): Promise { try { - const proc = spawnSync(`${process.platform === 'linux' ? 'dotnet ' : ''}${this.getDepotDownloaderExePath()}`); + const proc = process.platform === 'linux' + ? spawnSync('dotnet', [this.getDepotDownloaderExePath()]) + : spawnSync(this.getDepotDownloaderExePath()); if (proc.stderr?.toString()) { log.error("no dotnet", proc.stderr.toString()); return false; @@ -84,8 +86,8 @@ export class BSInstallerService { const args = DepotDownloader.buildArgs(depotDownloaderOptions); return new DepotDownloader({ - command: isLinux ? 'dotnet' : this.getDepotDownloaderExePath(), - args: isLinux ? [exePath, ...args] : [exePath], + command: isLinux ? 'dotnet' : exePath, + args: isLinux ? [exePath, ...args] : args, options: { cwd: this.installLocationService.versionsDirectory }, echoStartData: downloadVersion }, log); @@ -110,7 +112,7 @@ export class BSInstallerService { } return event; })).subscribe(sub); - + }).catch(err => sub.error({ type: DepotDownloaderEventType.Error, subType: DepotDownloaderErrorEvent.Unknown,