Update dist

This commit is contained in:
Kevin Gosse 2022-06-22 16:13:19 +02:00
parent d3901f97be
commit a69aaa20dc

15
dist/index.js vendored
View File

@ -243,8 +243,9 @@ class DotNetVersionInfo {
}
exports.DotNetVersionInfo = DotNetVersionInfo;
class DotnetCoreInstaller {
constructor(version, includePrerelease = false) {
constructor(version, architecture = '', includePrerelease = false) {
this.version = version;
this.architecture = architecture;
this.includePrerelease = includePrerelease;
}
installDotnet() {
@ -274,6 +275,9 @@ class DotnetCoreInstaller {
if (process.env['no_proxy'] != null) {
command += ` -ProxyBypassList ${process.env['no_proxy']}`;
}
if (this.architecture != '') {
command += ` -Architecture ${this.architecture}`;
}
// process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used
const powershellPath = yield io.which('powershell', true);
var options = {
@ -305,6 +309,9 @@ class DotnetCoreInstaller {
if (calculatedVersion) {
scriptArguments.push('--version', calculatedVersion);
}
if (this.architecture != '') {
scriptArguments.push('--architecture', this.architecture);
}
// process.env must be explicitly passed in for DOTNET_INSTALL_DIR to be used
resultCode = yield exec.exec(`"${scriptPath}"`, scriptArguments, {
listeners: {
@ -461,6 +468,10 @@ function run() {
// Proxy, auth, (etc) are still set up, even if no version is identified
//
let versions = core.getMultilineInput('dotnet-version');
let architecture = core.getInput('architecture');
if (!architecture) {
architecture = '';
}
const globalJsonFileInput = core.getInput('global-json-file');
if (globalJsonFileInput) {
const globalJsonPath = path.join(process.cwd(), globalJsonFileInput);
@ -482,7 +493,7 @@ function run() {
'true';
let dotnetInstaller;
for (const version of new Set(versions)) {
dotnetInstaller = new installer.DotnetCoreInstaller(version, includePrerelease);
dotnetInstaller = new installer.DotnetCoreInstaller(version, architecture, includePrerelease);
yield dotnetInstaller.installDotnet();
}
installer.DotnetCoreInstaller.addToPath();