Fix install dir for Windows

This commit is contained in:
IvanZosimov 2022-08-18 11:25:58 +02:00
parent 973bdde015
commit 813933aedb
2 changed files with 4 additions and 4 deletions

4
dist/index.js vendored
View File

@ -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]';

View File

@ -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);