diff --git a/deploy.ts b/deploy.ts index c1b4294b..4e70acd2 100644 --- a/deploy.ts +++ b/deploy.ts @@ -148,9 +148,7 @@ function generateModData(modId: string, changelogPath: string, modDir: string) { } const prerelease = metadata.version.includes('-'); - if (!prerelease) { - sawReleaseVersion = true; - } else if (sawReleaseVersion) { + if (prerelease && sawReleaseVersion) { continue; } @@ -166,6 +164,12 @@ function generateModData(modId: string, changelogPath: string, modDir: string) { fs.writeFileSync(modVersionFilePath, modFile); + if (!prerelease && !sawReleaseVersion) { + // Override root file with the latest release version. + fs.copyFileSync(path.join('mods', `${modId}.wh.cpp`), modVersionFilePath); + sawReleaseVersion = true; + } + const modVersionCompiled32FilePath = path.join(modDir, `${metadata.version}_32.dll`); const modVersionCompiled64FilePath = path.join(modDir, `${metadata.version}_64.dll`); const cachedMod32Path = findCachedMod(modId, metadata.version, '32');