mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-30 02:23:33 +00:00
fix(scripts): reject short flag startup memory paths
This commit is contained in:
@@ -49,7 +49,7 @@ function readNonEmptyEnv(name) {
|
||||
|
||||
function readRequiredPathOption(argv, index, flag) {
|
||||
const value = argv[index + 1];
|
||||
if (!value || value.startsWith("--")) {
|
||||
if (!value || value.startsWith("-")) {
|
||||
throw new Error(`${flag} requires a path`);
|
||||
}
|
||||
return value;
|
||||
|
||||
@@ -107,8 +107,10 @@ describe("check-cli-startup-memory", () => {
|
||||
for (const args of [
|
||||
["--json"],
|
||||
["--json", "--summary"],
|
||||
["--json", "-h"],
|
||||
["--summary"],
|
||||
["--summary", "--json"],
|
||||
["--summary", "-h"],
|
||||
]) {
|
||||
expect(() => testing.parseArgs(args)).toThrow(/--(?:json|summary) requires a path/u);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user