patch to extract file from other location

This commit is contained in:
mahabaleshwars 2024-03-14 14:39:38 +05:30
parent 5896cecc08
commit a847c75719
3 changed files with 17 additions and 0 deletions

View file

@ -119,6 +119,13 @@ export function getVersionFromFileContent(
versionFile: string
): string | null {
let javaVersionRegExp: RegExp;
const path = require('path');
function getFileName(versionFile: string) {
return path.basename(versionFile);
}
const versionFileName = getFileName(versionFile);
if (versionFile == '.tool-versions') {
javaVersionRegExp =
/^(java\s+)(?:\S*-)?v?(?<version>(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m;