Move changelog loading to server

Summary: per title

Reviewed By: aigoncharov

Differential Revision: D32723706

fbshipit-source-id: ce5108da9f5da6fdfa7d1a66a31a4f8f430eb78d
This commit is contained in:
Michel Weststrate
2021-12-08 04:25:28 -08:00
committed by Facebook GitHub Bot
parent eab4f0d3d3
commit 129cbd6f7b
7 changed files with 55 additions and 55 deletions

View File

@@ -30,7 +30,16 @@ export function getStaticPath(
: absolutePath;
}
export function getChangelogPath() {
export async function getChangelog() {
return (
await fs.promises.readFile(
path.join(getChangelogPath(), 'CHANGELOG.md'),
'utf8',
)
).trim();
}
function getChangelogPath() {
const changelogPath = getStaticPath(isFBBuild ? 'facebook' : '.');
if (fs.existsSync(changelogPath)) {
return changelogPath;