Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaucasau committed Feb 22, 2024
1 parent e80743d commit e200622
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
11 changes: 8 additions & 3 deletions scripts/commands/convertApiDocsToHistorical.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,14 @@ async function copyApiDocsAndUpdateLinks(
);
}

const source = `${getRoot()}/docs/api/${pkgName}/release-notes/${versionWithoutPatch}.md`;
if (await pathExists(source)) {
updateLinksFile(pkgName, versionWithoutPatch, source, source);
const releaseNotePath = `${getRoot()}/docs/api/${pkgName}/release-notes/${versionWithoutPatch}.md`;
if (await pathExists(releaseNotePath)) {
updateLinksFile(
pkgName,
versionWithoutPatch,
releaseNotePath,
releaseNotePath,
);
}
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/commands/updateApiDocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
addNewReleaseNotes,
generateReleaseNotesIndex,
updateHistoricalTocFiles,
writeSeparateReleaseNotes,
writeReleaseNoteForVersion,
} from "../lib/api/releaseNotes";

interface Arguments {
Expand Down Expand Up @@ -243,7 +243,7 @@ async function convertHtmlToMarkdown(
: `${baseUrl}/${link}`,
);

await writeSeparateReleaseNotes(pkg, result.markdown);
await writeReleaseNoteForVersion(pkg, result.markdown);
continue;
}

Expand Down
6 changes: 3 additions & 3 deletions scripts/lib/api/releaseNotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ function addNewReleaseNoteToc(releaseNotesNode: any, newVersion: string) {
}

/**
* Updates the release notes folder by adding the notes to their corresponding version
* file.
* Creates the release note file for the minor version found in `pkg`.If the file
* already exists, it will keep the initial header and overwrite the rest of the content.
*/
export async function writeSeparateReleaseNotes(
export async function writeReleaseNoteForVersion(
pkg: Pkg,
releaseNoteMarkdown: string,
): Promise<void> {
Expand Down

0 comments on commit e200622

Please sign in to comment.