fix(scripts): reject short flag shrinkwrap refs · openclaw/openclaw@75a997d
vincentkoc
·
2026-06-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -16,6 +16,7 @@ import {
|
16 | 16 | pnpmLockOverrideVersionForVersions, |
17 | 17 | parsePnpmPackageKey, |
18 | 18 | parseLockPackagePath, |
| 19 | +resolvePackageDirs, |
19 | 20 | restoreCurrentPnpmLockedPackages, |
20 | 21 | shouldUseLegacyPeerDepsForShrinkwrap, |
21 | 22 | shrinkwrapPackageDirsForChangedPaths, |
@@ -57,6 +58,18 @@ describe("generate-npm-shrinkwrap", () => {
|
57 | 58 | }); |
58 | 59 | }); |
59 | 60 | |
| 61 | +it("rejects short flag package selectors before resolving shrinkwrap targets", () => { |
| 62 | +expect(() => resolvePackageDirs(["--package-dir", "-h"])).toThrow( |
| 63 | +"--package-dir requires a package directory.", |
| 64 | +); |
| 65 | +expect(() => resolvePackageDirs(["--changed", "--base", "-h"])).toThrow( |
| 66 | +"--base requires a git ref.", |
| 67 | +); |
| 68 | +expect(() => resolvePackageDirs(["--changed", "--head", "-h"])).toThrow( |
| 69 | +"--head requires a git ref.", |
| 70 | +); |
| 71 | +}); |
| 72 | + |
60 | 73 | it("accepts strict npm shrinkwrap command timeout and buffer overrides", () => { |
61 | 74 | expect( |
62 | 75 | createNpmShrinkwrapExecOptions({ command: "npm", args: ["install"] }, "/tmp/package", { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。