From 813933aedba4c80b223841ce626e695cf2a52816 Mon Sep 17 00:00:00 2001 From: IvanZosimov Date: Thu, 18 Aug 2022 11:25:58 +0200 Subject: [PATCH] Fix install dir for Windows --- dist/index.js | 4 ++-- src/installer.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 210cdf3..8942fb9 100644 --- a/dist/index.js +++ b/dist/index.js @@ -282,7 +282,7 @@ class DotnetCoreInstaller { if (process.env['no_proxy'] != null) { command += ` -ProxyBypassList ${process.env['no_proxy']}`; } - command += ` -InstallDir ${DotnetCoreInstaller.installationDirectoryWindows}`; + command += ` -InstallDir '${DotnetCoreInstaller.installationDirectoryWindows}'`; // process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used const powershellPath = yield io.which('powershell', true); var options = { @@ -357,7 +357,7 @@ class DotnetCoreInstaller { } } exports.DotnetCoreInstaller = DotnetCoreInstaller; -DotnetCoreInstaller.installationDirectoryWindows = `'${path.join(process.env['PROGRAMFILES'] + '', "dotnet")}'`; +DotnetCoreInstaller.installationDirectoryWindows = path.join(process.env['PROGRAMFILES'] + '', "dotnet"); DotnetCoreInstaller.installationDirectoryLinux = '/usr/share/dotnet'; function logWarning(message) { const warningPrefix = '[warning]'; diff --git a/src/installer.ts b/src/installer.ts index 86fee04..5f5c5b3 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -83,7 +83,7 @@ export class DotnetVersionResolver { export class DotnetCoreInstaller { private version: string; private quality: string; - static installationDirectoryWindows = `'${path.join(process.env['PROGRAMFILES'] + '', "dotnet")}'`; + static installationDirectoryWindows = path.join(process.env['PROGRAMFILES'] + '', "dotnet"); static installationDirectoryLinux = '/usr/share/dotnet'; constructor(version: string, quality: string) { @@ -130,7 +130,7 @@ export class DotnetCoreInstaller { command += ` -ProxyBypassList ${process.env['no_proxy']}`; } - command += ` -InstallDir ${DotnetCoreInstaller.installationDirectoryWindows}`; + command += ` -InstallDir '${DotnetCoreInstaller.installationDirectoryWindows}'`; // process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used const powershellPath = await io.which('powershell', true);