Skip to content

Commit d170cd6

Browse files
committed
2.0.2 - Make version parse regex more lenient.
1 parent 895d38c commit d170cd6

File tree

4 files changed

+82
-78
lines changed

4 files changed

+82
-78
lines changed

lib/java/JavaGuard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ export function parseJavaRuntimeVersion(verString: string): JavaVersion {
719719
export function parseJavaRuntimeVersionLegacy(verString: string): JavaVersion {
720720
// 1.{major}.0_{update}-b{build}
721721
// ex. 1.8.0_152-b16
722-
const regex = /^1.(\d+).(\d+)_(\d+)(?:-b(\d+))?$/
722+
const regex = /1.(\d+).(\d+)_(\d+)(?:-b(\d+))?/
723723
const match = regex.exec(verString)!
724724

725725
if(match == null) {
@@ -744,7 +744,7 @@ export function parseJavaRuntimeVersionLegacy(verString: string): JavaVersion {
744744
export function parseJavaRuntimeVersionSemver(verString: string): JavaVersion {
745745
// {major}.{minor}.{patch}+{build}
746746
// ex. 10.0.2+13 or 10.0.2.13
747-
const regex = /^(\d+)\.(\d+).(\d+)(?:[+.](\d+))?$/
747+
const regex = /(\d+)\.(\d+).(\d+)(?:[+.](\d+))?/
748748
const match = regex.exec(verString)!
749749

750750
if(match == null) {

package-lock.json

Lines changed: 73 additions & 70 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "helios-core",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "A library containing core mechanisms for Helios Launcher",
55
"main": "dist/index.js",
66
"scripts": {
@@ -63,16 +63,16 @@
6363
"@types/fs-extra": "^11.0.1",
6464
"@types/luxon": "^3.2.0",
6565
"@types/mocha": "^10.0.1",
66-
"@types/node": "^18.15.7",
66+
"@types/node": "^18.15.11",
6767
"@types/tar-fs": "^2.0.1",
6868
"@types/triple-beam": "^1.3.2",
6969
"@types/winreg": "^1.2.31",
70-
"@typescript-eslint/eslint-plugin": "^5.56.0",
71-
"@typescript-eslint/parser": "^5.56.0",
70+
"@typescript-eslint/eslint-plugin": "^5.57.0",
71+
"@typescript-eslint/parser": "^5.57.0",
7272
"chai": "^4.3.7",
7373
"chai-as-promised": "^7.1.1",
7474
"cross-env": "^7.0.3",
75-
"eslint": "^8.36.0",
75+
"eslint": "^8.37.0",
7676
"helios-distribution-types": "^1.2.0",
7777
"mocha": "^10.2.0",
7878
"nock": "^13.3.0",

test/java/JavaGuardTest.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ describe('JavaGuard', () => {
9494
['1.8.0_351', { major: 8, minor: 0, patch: 351, build: undefined }],
9595
['1.8.0_351-b10', { major: 8, minor: 0, patch: 351, build: 10 }],
9696
['17.0.5', { major: 17, minor: 0, patch: 5, build: undefined }],
97-
['17.0.5.8', { major: 17, minor: 0, patch: 5, build: 8 }]
97+
['17.0.5.8', { major: 17, minor: 0, patch: 5, build: 8 }],
98+
['17.0.6+9-LTS-190', { major: 17, minor: 0, patch: 6, build: 9 }]
9899
]
99100

100101
for(const [test, res] of testMatrix) {

0 commit comments

Comments
 (0)