Skip to content

Commit ac5fa52

Browse files
author
David B
committed
add fallback on releasename while searching
1 parent 0a80e9c commit ac5fa52

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"license": "MIT",
88
"scripts": {
99
"start": "node _switch-backup-rename.js",
10+
"dev": "./build/_switch-backup-rename-macos",
1011
"clean": "rm -rf ./build",
1112
"build": "pkg --targets linux,macos,win --out-path build _switch-backup-rename.js",
1213
"compress": "cd ./build/ && ls | xargs -I {} zip {}.zip {}"

utils/filter-helpers.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ function getCurrentGameInfo(searchPattern, gamesInfos) {
7474
}
7575
}
7676
}
77+
// fallback on releasename
78+
for (let i = 0; i < gamesInfos.length; i++) {
79+
const gameInfos = gamesInfos[i];
80+
if (gameInfos.releasename) {
81+
const regexp = new RegExp(sanitizeFileName(gameInfos.releasename));
82+
if (regexp.test(searchPattern.toLowerCase())) {
83+
return gameInfos;
84+
}
85+
}
86+
}
7787
return false;
7888
}
7989

0 commit comments

Comments
 (0)