Fix logic

This commit is contained in:
IvanZosimov 2022-09-30 14:53:08 +02:00
parent 0949c87857
commit 1225bf2b8a
2 changed files with 8 additions and 8 deletions

8
dist/index.js vendored
View File

@ -337,7 +337,7 @@ class DotnetCoreInstaller {
if (process.env['no_proxy'] != null) {
scriptArguments.push(`-ProxyBypassList ${process.env['no_proxy']}`);
}
if (!process.env['DOTNET_INSTALL_DIR']) {
if (!dotnetInstallDir) {
scriptArguments.push('-InstallDir', `'${DotnetCoreInstaller.installationDirectoryWindows}'`);
}
// process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used
@ -355,7 +355,7 @@ class DotnetCoreInstaller {
if (this.quality) {
this.setQuality(dotnetVersion, scriptArguments);
}
if (!process.env['DOTNET_INSTALL_DIR']) {
if (!dotnetInstallDir) {
scriptArguments.push('--install-dir', utils_1.IS_LINUX
? DotnetCoreInstaller.installationDirectoryLinux
: DotnetCoreInstaller.installationDirectoryMac);
@ -365,8 +365,8 @@ class DotnetCoreInstaller {
if (exitCode) {
throw new Error(`Failed to install dotnet ${exitCode}. ${stdout}`);
}
return this.outputDotnetVersion(dotnetVersion.value, process.env['DOTNET_INSTALL_DIR']
? process.env['DOTNET_INSTALL_DIR']
return this.outputDotnetVersion(dotnetVersion.value, dotnetInstallDir
? dotnetInstallDir
: scriptArguments[scriptArguments.length - 1]);
});
}

View File

@ -212,7 +212,7 @@ export class DotnetCoreInstaller {
scriptArguments.push(`-ProxyBypassList ${process.env['no_proxy']}`);
}
if (!process.env['DOTNET_INSTALL_DIR']) {
if (!dotnetInstallDir) {
scriptArguments.push(
'-InstallDir',
`'${DotnetCoreInstaller.installationDirectoryWindows}'`
@ -235,7 +235,7 @@ export class DotnetCoreInstaller {
this.setQuality(dotnetVersion, scriptArguments);
}
if (!process.env['DOTNET_INSTALL_DIR']) {
if (!dotnetInstallDir) {
scriptArguments.push(
'--install-dir',
IS_LINUX
@ -255,8 +255,8 @@ export class DotnetCoreInstaller {
return this.outputDotnetVersion(
dotnetVersion.value,
process.env['DOTNET_INSTALL_DIR']
? process.env['DOTNET_INSTALL_DIR']
dotnetInstallDir
? dotnetInstallDir
: scriptArguments[scriptArguments.length - 1]
);
}