fix(scripts): reject short flag docker package values · openclaw/openclaw@6daf930
vincentkoc
·
2026-06-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -67,14 +67,14 @@ function resolveTimeoutMs(envName, defaultValue) {
|
67 | 67 | |
68 | 68 | function readOptionValue(argv, index, optionName) { |
69 | 69 | const value = argv[index + 1]; |
70 | | -if (value === undefined || value === "" || value.startsWith("--")) { |
| 70 | +if (value === undefined || value === "" || value.startsWith("-")) { |
71 | 71 | throw new Error(`${optionName} requires a value`); |
72 | 72 | } |
73 | 73 | return value; |
74 | 74 | } |
75 | 75 | |
76 | 76 | function readEqualsOptionValue(value, optionName) { |
77 | | -if (value === "" || value.startsWith("--")) { |
| 77 | +if (value === "" || value.startsWith("-")) { |
78 | 78 | throw new Error(`${optionName} requires a value`); |
79 | 79 | } |
80 | 80 | return value; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -98,7 +98,9 @@ describe("package-openclaw-for-docker", () => {
|
98 | 98 | for (const flag of ["--output-dir", "--output-name", "--source-dir"]) { |
99 | 99 | expect(() => parseArgs([flag])).toThrow(`${flag} requires a value`); |
100 | 100 | expect(() => parseArgs([flag, "--skip-build"])).toThrow(`${flag} requires a value`); |
| 101 | +expect(() => parseArgs([flag, "-h"])).toThrow(`${flag} requires a value`); |
101 | 102 | expect(() => parseArgs([`${flag}=`])).toThrow(`${flag} requires a value`); |
| 103 | +expect(() => parseArgs([`${flag}=-h`])).toThrow(`${flag} requires a value`); |
102 | 104 | } |
103 | 105 | }); |
104 | 106 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。