From 19a7053575135c3320c8bd1b9d9bd12dba31c69e Mon Sep 17 00:00:00 2001 From: 1aerostorm Date: Wed, 18 Jan 2023 00:40:40 +0000 Subject: [PATCH] Allow multi-hyphen in file names --- index.mjs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.mjs b/index.mjs index 133552e..1d521fa 100644 --- a/index.mjs +++ b/index.mjs @@ -61,9 +61,11 @@ function getAppVersions(name, platform, after = null, latest = false) { .filter(dirent => dirent.isFile()) .map(dirent => dirent.name) for (let file of files) { - const [ productName, _rest ] = file.split('-') - if (!_rest) continue - const verParts = _rest.split('.') + const parts = file.split('-') + if (parts.length < 2) continue + const verExt = parts.pop() + + const verParts = verExt.split('.') const ext = verParts.pop() let curVer = verParts.join('.') if (verParts.length === 2) {