mirror of
https://github.com/actions/setup-java.git
synced 2025-04-21 02:16:45 +00:00
rebuild
This commit is contained in:
parent
a2ae8283cb
commit
10d2aa6bfd
2 changed files with 10 additions and 4 deletions
|
@ -1,7 +1,12 @@
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as auth from './auth';
|
import * as auth from './auth';
|
||||||
import { getBooleanInput, isCacheFeatureAvailable, getVersionFromFileContent, avoidOldNotation } from './util';
|
import {
|
||||||
|
getBooleanInput,
|
||||||
|
isCacheFeatureAvailable,
|
||||||
|
getVersionFromFileContent,
|
||||||
|
avoidOldNotation
|
||||||
|
} from './util';
|
||||||
import * as toolchains from './toolchains';
|
import * as toolchains from './toolchains';
|
||||||
import * as constants from './constants';
|
import * as constants from './constants';
|
||||||
import { restore } from './cache';
|
import { restore } from './cache';
|
||||||
|
@ -120,4 +125,3 @@ interface installerInputsOptions {
|
||||||
jdkFile: string;
|
jdkFile: string;
|
||||||
toolchainIds: Array<string>;
|
toolchainIds: Array<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,8 +100,10 @@ export function isCacheFeatureAvailable(): boolean {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getVersionFromFileContent(
|
||||||
export function getVersionFromFileContent(content: string, distributionName: string): string | null {
|
content: string,
|
||||||
|
distributionName: string
|
||||||
|
): string | null {
|
||||||
const javaVersionRegExp = /(?<version>(?<=(^|\s|\-))(\d+\S*))(\s|$)/;
|
const javaVersionRegExp = /(?<version>(?<=(^|\s|\-))(\d+\S*))(\s|$)/;
|
||||||
const fileContent = content.match(javaVersionRegExp)?.groups?.version
|
const fileContent = content.match(javaVersionRegExp)?.groups?.version
|
||||||
? (content.match(javaVersionRegExp)?.groups?.version as string)
|
? (content.match(javaVersionRegExp)?.groups?.version as string)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue