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