mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
fix(scripts): reject short flag vitest profile dirs
This commit is contained in:
@@ -12,7 +12,7 @@ import { createPnpmRunnerSpawnSpec } from "./pnpm-runner.mjs";
|
||||
*/
|
||||
function readOutputDirValue(argv, index) {
|
||||
const value = argv[index + 1];
|
||||
if (value === undefined || value === "" || value.startsWith("--")) {
|
||||
if (value === undefined || value === "" || value.startsWith("-")) {
|
||||
throw new Error("Expected --output-dir <dir>.");
|
||||
}
|
||||
return value;
|
||||
|
||||
@@ -91,6 +91,9 @@ describe("scripts/run-vitest-profile", () => {
|
||||
|
||||
it("rejects missing profile output directories", () => {
|
||||
expect(() => parseArgs(["runner", "--output-dir"])).toThrow("Expected --output-dir <dir>.");
|
||||
expect(() => parseArgs(["runner", "--output-dir", "-h"])).toThrow(
|
||||
"Expected --output-dir <dir>.",
|
||||
);
|
||||
expect(() => parseArgs(["runner", "--output-dir", "--", "--config", "custom.ts"])).toThrow(
|
||||
"Expected --output-dir <dir>.",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user