From 43e00c06c3c99eafac519f7ec29bc2a67708a2ea Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 21 Jun 2026 20:13:50 +0200 Subject: [PATCH] fix(docs): reject sync publish flag values --- scripts/docs-sync-publish.mjs | 2 +- test/scripts/docs-sync-publish.test.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/docs-sync-publish.mjs b/scripts/docs-sync-publish.mjs index 070264927bf..9feae78f235 100644 --- a/scripts/docs-sync-publish.mjs +++ b/scripts/docs-sync-publish.mjs @@ -172,7 +172,7 @@ const GENERATED_LOCALES = [ function readOptionValue(argv, index, optionName) { const value = argv[index + 1]; - if (value === undefined || value === "" || value.startsWith("--")) { + if (value === undefined || value === "" || value.startsWith("-")) { throw new Error(`${optionName} requires a value`); } return value; diff --git a/test/scripts/docs-sync-publish.test.ts b/test/scripts/docs-sync-publish.test.ts index 886f5c98b51..eb9b4723acf 100644 --- a/test/scripts/docs-sync-publish.test.ts +++ b/test/scripts/docs-sync-publish.test.ts @@ -41,6 +41,7 @@ describe("docs-sync-publish", () => { expect(() => parseArgs([flag, "--target", "generated-docs"])).toThrow( `${flag} requires a value`, ); + expect(() => parseArgs([flag, "-h"])).toThrow(`${flag} requires a value`); } }); });