Win32Updater: Filtering

This commit is contained in:
thororen1234 2025-09-02 05:15:06 -04:00
parent 9ba83b5bb5
commit 2f35d700ec
No known key found for this signature in database

View file

@ -37,11 +37,9 @@ function patchLatest() {
const currentVersion = basename(currentAppPath);
const discordPath = join(currentAppPath, "..");
const latestVersion = readdirSync(discordPath).reduce((prev, curr) => {
return (curr.startsWith("app-") && isNewer(curr, prev))
? curr
: prev;
}, currentVersion as string);
const latestVersion = readdirSync(discordPath)
.filter(name => name.startsWith("app-") && statSync(join(discordPath, name)).isDirectory())
.reduce((prev, curr) => isNewer(curr, prev) ? curr : prev, currentVersion as string);
if (latestVersion === currentVersion) return;