Skip to content

Commit 1c032ad

Browse files
committed
Sanitize commander inputs in buildScripts/generateSeoFiles.mjs #7986
1 parent e89736a commit 1c032ad

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

buildScripts/generateSeoFiles.mjs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {Command} from 'commander/esm.mjs';
44
import {execSync} from 'child_process';
55
import {fileURLToPath} from 'url';
66
import fg from 'fast-glob';
7+
import {sanitizeInput} from './util/Sanitizer.mjs';
78

89
const ROOT_DIR = process.cwd();
910
const LEARN_DIR = path.resolve(ROOT_DIR, 'learn');
@@ -542,12 +543,12 @@ async function runCli() {
542543
program
543544
.name('generate-seo-files')
544545
.description('Generates sitemap.xml and llms.txt for SEO purposes.')
545-
.option('-f, --format <type>', 'Output format: array, objects, urls, xml, llms')
546-
.option('--base-url <url>', 'Absolute base URL (e.g., https://neomjs.com)')
547-
.option('--base-path <path>', 'Base path for content routes')
548-
.option('-o, --output <path>', 'Output file path')
549-
.option('--no-lastmod', 'Exclude <lastmod> tags from sitemap.xml')
550-
.option('--no-top-level', 'Exclude top-level routes');
546+
.option('-f, --format <type>', 'Output format: array, objects, urls, xml, llms', sanitizeInput)
547+
.option('--base-url <url>', 'Absolute base URL (e.g., https://neomjs.com)', sanitizeInput)
548+
.option('--base-path <path>', 'Base path for content routes', sanitizeInput)
549+
.option('-o, --output <path>', 'Output file path', sanitizeInput)
550+
.option('--no-lastmod', 'Exclude <lastmod> tags from sitemap.xml')
551+
.option('--no-top-level', 'Exclude top-level routes');
551552

552553
program.parse(process.argv);
553554

0 commit comments

Comments
 (0)