From 6ee180a3a923fc97bf1b02146c71957b8058c647 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 18 Dec 2024 17:24:00 +0000 Subject: [PATCH] deploy: a52cba2cccfdfb5b68245e3af5cc0ddcf3b3f8d1 --- deploy.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/deploy.ts b/deploy.ts index a4056b5c..6d394a67 100644 --- a/deploy.ts +++ b/deploy.ts @@ -143,13 +143,16 @@ function getModChangelogTextForVersion(modId: string, modVersion: string, commit } function generateModData(modId: string, changelogPath: string, modDir: string) { - fs.mkdirSync(modDir); + if (!fs.existsSync(modDir)) { + fs.mkdirSync(modDir); + } let changelog = ''; const versions: { version: string; prerelease?: boolean; }[] = []; + let sawReleaseVersion = false; const modSourceUtils = new ModSourceUtils('mods'); @@ -173,9 +176,16 @@ function generateModData(modId: string, changelogPath: string, modDir: string) { throw new Error(`Mod ${modId} has no version in commit ${commit}`); } + const prerelease = metadata.version.includes('-'); + if (!prerelease) { + sawReleaseVersion = true; + } else if (sawReleaseVersion) { + continue; + } + versions.unshift({ version: metadata.version, - ...(metadata.version.includes('-') ? { prerelease: true } : {}), + ...(prerelease ? { prerelease: true } : {}), }); const modVersionFilePath = path.join(modDir, `${metadata.version}.wh.cpp`);