fix (transformations): only generate markdown when script is run (#117359)

fix: only generate markdown when script is run
This commit is contained in:
Alex Spencer 2026-02-03 16:02:42 -08:00 committed by GitHub
parent 9454d60237
commit e04a9a80bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -227,8 +227,15 @@ export function getJavaScriptContent(): string {
return completeTemplate;
}
// Build the path to the Markdown file.
const indexPath = resolve(__dirname, '../../' + WRITE_PATH);
export function generateMarkdown(): void {
// Build the path to the Markdown file.
const indexPath = resolve(__dirname, '../../' + WRITE_PATH);
// Write content to the Markdown file.
writeFileSync(indexPath, completeTemplate, 'utf-8');
}
// Write content to the Markdown file.
writeFileSync(indexPath, completeTemplate, 'utf-8');
// Only run the generation if this file is executed directly (not imported)
// This is a Node.js specific way to ensure the file is executed directly.
if (require.main === module) {
generateMarkdown();
}