From 1225bf2b8a37ff800daa2deaa47f03d79d8e0c34 Mon Sep 17 00:00:00 2001 From: IvanZosimov Date: Fri, 30 Sep 2022 14:53:08 +0200 Subject: [PATCH] Fix logic --- dist/index.js | 8 ++++---- src/installer.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index 7ba0702..371b043 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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]); }); } diff --git a/src/installer.ts b/src/installer.ts index ecae01d..56869fa 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -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] ); }