Skip to content

Commit

Permalink
Override root file with the latest release mod version
Browse files Browse the repository at this point in the history
  • Loading branch information
m417z committed Dec 21, 2024
1 parent 3bd424b commit a166af7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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');
Expand Down

0 comments on commit a166af7

Please sign in to comment.