Skip to content

Commit

Permalink
deploy: a52cba2
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 18, 2024
1 parent a3c12aa commit 6ee180a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');

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

0 comments on commit 6ee180a

Please sign in to comment.