fix(installer): reject invalid shell options · openclaw/openclaw@6c5b392
vincentkoc
·
2026-05-26
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -104,6 +104,18 @@ function writeNpmBeforePolicyFixture(path: string, argsLog: string) {
|
104 | 104 | describe("install-cli.sh", () => { |
105 | 105 | const script = readFileSync(SCRIPT_PATH, "utf8"); |
106 | 106 | |
| 107 | +it("rejects installer options with missing values", () => { |
| 108 | +const result = runInstallCliShell(` |
| 109 | + set -euo pipefail |
| 110 | + source "${SCRIPT_PATH}" |
| 111 | + parse_args --prefix --no-onboard |
| 112 | + `); |
| 113 | + |
| 114 | +expect(result.status).toBe(1); |
| 115 | +expect(result.stdout + result.stderr).toContain("Missing value for --prefix"); |
| 116 | +expect(result.stdout + result.stderr).not.toContain("unbound variable"); |
| 117 | +}); |
| 118 | + |
107 | 119 | it("keeps HOME for default prefix while OPENCLAW_HOME controls git checkout paths", () => { |
108 | 120 | const tmp = mkdtempSync(join(tmpdir(), "openclaw-install-cli-home-")); |
109 | 121 | const osHome = join(tmp, "os-home"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。