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`); } }); });