mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 01:46:46 +00:00
Move os.arch() defaulter to JavaBase constructor
This commit is contained in:
parent
a115f58891
commit
cca7653671
2 changed files with 3 additions and 3 deletions
|
@ -7,6 +7,7 @@ import * as httpm from '@actions/http-client';
|
|||
import { getToolcachePath, isVersionSatisfies } from '../util';
|
||||
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from './base-models';
|
||||
import { MACOS_JAVA_CONTENT_POSTFIX } from '../constants';
|
||||
import os from 'os';
|
||||
|
||||
export abstract class JavaBase {
|
||||
protected http: httpm.HttpClient;
|
||||
|
@ -25,7 +26,7 @@ export abstract class JavaBase {
|
|||
({ version: this.version, stable: this.stable } = this.normalizeVersion(
|
||||
installerOptions.version
|
||||
));
|
||||
this.architecture = installerOptions.architecture;
|
||||
this.architecture = installerOptions.architecture || os.arch();
|
||||
this.packageType = installerOptions.packageType;
|
||||
this.checkLatest = installerOptions.checkLatest;
|
||||
}
|
||||
|
|
|
@ -6,13 +6,12 @@ import { restore } from './cache';
|
|||
import * as path from 'path';
|
||||
import { getJavaDistribution } from './distributions/distribution-factory';
|
||||
import { JavaInstallerOptions } from './distributions/base-models';
|
||||
import * as os from 'os';
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
const version = core.getInput(constants.INPUT_JAVA_VERSION, { required: true });
|
||||
const distributionName = core.getInput(constants.INPUT_DISTRIBUTION, { required: true });
|
||||
const architecture = core.getInput(constants.INPUT_ARCHITECTURE) || os.arch();
|
||||
const architecture = core.getInput(constants.INPUT_ARCHITECTURE);
|
||||
const packageType = core.getInput(constants.INPUT_JAVA_PACKAGE);
|
||||
const jdkFile = core.getInput(constants.INPUT_JDK_FILE);
|
||||
const cache = core.getInput(constants.INPUT_CACHE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue