Move changelog loading to server
Summary: per title Reviewed By: aigoncharov Differential Revision: D32723706 fbshipit-source-id: ce5108da9f5da6fdfa7d1a66a31a4f8f430eb78d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
eab4f0d3d3
commit
129cbd6f7b
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user