mirror of
https://github.com/actions/setup-java.git
synced 2025-04-19 17:36:45 +00:00
parse version
This commit is contained in:
parent
680565b9c5
commit
8dcd17f2ef
2 changed files with 6 additions and 0 deletions
3
dist/setup/index.js
vendored
3
dist/setup/index.js
vendored
|
@ -105044,6 +105044,7 @@ const constants = __importStar(__nccwpck_require__(9042));
|
|||
const cache_1 = __nccwpck_require__(4810);
|
||||
const path = __importStar(__nccwpck_require__(1017));
|
||||
const distribution_factory_1 = __nccwpck_require__(924);
|
||||
const semver = __importStar(__nccwpck_require__(1383));
|
||||
function run() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
|
@ -105059,6 +105060,8 @@ function run() {
|
|||
core.debug("JAVA_VERSION input is empty, looking for .java-version file");
|
||||
const versionFileName = '.java-version';
|
||||
const contents = fs_1.default.readFileSync(versionFileName).toString().trim();
|
||||
const version = semver.valid(contents);
|
||||
core.info(version ? version : "not found");
|
||||
versions.push(contents);
|
||||
}
|
||||
if (versions.length !== toolchainIds.length) {
|
||||
|
|
|
@ -8,6 +8,7 @@ import { restore } from './cache';
|
|||
import * as path from 'path';
|
||||
import { getJavaDistribution } from './distributions/distribution-factory';
|
||||
import { JavaInstallerOptions } from './distributions/base-models';
|
||||
import * as semver from 'semver';
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
|
@ -24,6 +25,8 @@ async function run() {
|
|||
core.debug("JAVA_VERSION input is empty, looking for .java-version file")
|
||||
const versionFileName = '.java-version'
|
||||
const contents = fs.readFileSync(versionFileName).toString().trim();
|
||||
const version = semver.valid(contents);
|
||||
core.info(version ? version : "not found")
|
||||
versions.push(contents)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue