Skip to content

Commit

Permalink
Allow multi-hyphen in file names
Browse files Browse the repository at this point in the history
  • Loading branch information
1aerostorm committed Jan 18, 2023
1 parent dac5588 commit 19a7053
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 19a7053

Please sign in to comment.