mirror of
https://github.com/grafana/grafana.git
synced 2026-02-03 20:49:50 -05:00
fix (transformations): only generate markdown when script is run (#117359)
fix: only generate markdown when script is run
This commit is contained in:
parent
9454d60237
commit
e04a9a80bb
1 changed files with 11 additions and 4 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue