fix(scripts): reject option-shaped package candidate values · openclaw/openclaw@102ab75
vincentkoc
·
2026-06-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -174,6 +174,28 @@ describe("resolve-openclaw-package-candidate", () => {
|
174 | 174 | }); |
175 | 175 | }); |
176 | 176 | |
| 177 | +it("rejects option-shaped package candidate option values", () => { |
| 178 | +for (const flag of [ |
| 179 | +"--artifact-dir", |
| 180 | +"--github-output", |
| 181 | +"--metadata", |
| 182 | +"--output-dir", |
| 183 | +"--output-name", |
| 184 | +"--package-ref", |
| 185 | +"--package-spec", |
| 186 | +"--package-url", |
| 187 | +"--package-sha256", |
| 188 | +"--source", |
| 189 | +"--trusted-source-id", |
| 190 | +"--trusted-source-policy", |
| 191 | +]) { |
| 192 | +expect(() => parseArgs([flag, "--output-dir", "out"]), flag).toThrow( |
| 193 | +`${flag} requires a value`, |
| 194 | +); |
| 195 | +expect(() => parseArgs([flag, "-h"]), flag).toThrow(`${flag} requires a value`); |
| 196 | +} |
| 197 | +}); |
| 198 | + |
177 | 199 | it("rejects package candidate output names that escape the output directory", () => { |
178 | 200 | for (const outputName of [ |
179 | 201 | "../openclaw-current.tgz", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。