Fix Mod Changes Generation Edge Case + Cleanup (#583)

[SKIP]
This commit is contained in:
Integer Limit 2023-12-17 19:41:39 +11:00 committed by GitHub
parent 835ba9ef06
commit 37ce028e7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -17,9 +17,11 @@ const getModChangesFormatting: (commits: Commit[]) => SpecialChangelogFormatting
return { return {
formatting: (message, subMessage, indentation, commits) => { formatting: (message, subMessage, indentation, commits) => {
// Sub messages are details, so make them bold & italic // Sub messages are details, so make them bold & italic
if (subMessage) { if (subMessage) return `${indentation}* ***${message}***`;
return `${indentation}* ***${message}***`;
} // Edge Case
if (!commits) return `${indentation}* ${message}`;
if (commits.length > 1) { if (commits.length > 1) {
const authors: string[] = []; const authors: string[] = [];
const formattedCommits: string[] = []; const formattedCommits: string[] = [];

View File

@ -30,12 +30,11 @@ export async function createModList(tag = ""): Promise<ModFileInfo[]> {
// Fetch mod/addon & file infos, discard result. Further calls will hit cache. // Fetch mod/addon & file infos, discard result. Further calls will hit cache.
await fetchProjectsBulk(manifest.files.map((mod) => mod.projectID)); await fetchProjectsBulk(manifest.files.map((mod) => mod.projectID));
await fetchFilesBulk( await fetchFilesBulk(
// Use this instead of referencing the original array, as .sort sorts the input array manifest.files
[...manifest.files]
.sort((a, b) => a.fileID - b.fileID)
.map((mod) => { .map((mod) => {
return { projectID: mod.projectID, fileID: mod.fileID }; return { projectID: mod.projectID, fileID: mod.fileID };
}), })
.sort((a, b) => a.fileID - b.fileID),
); );
log("Fetched Infos. Creating modlist..."); log("Fetched Infos. Creating modlist...");