mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 05:54:43 +00:00
fix: support bun lockfile detection
This commit is contained in:
@@ -19,9 +19,13 @@ describe("detectPackageManager", () => {
|
||||
|
||||
it("falls back to lockfiles when package.json is missing or unsupported", async () => {
|
||||
const bunRoot = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-detect-pm-"));
|
||||
await fs.writeFile(path.join(bunRoot, "bun.lockb"), "", "utf8");
|
||||
await fs.writeFile(path.join(bunRoot, "bun.lock"), "", "utf8");
|
||||
await expect(detectPackageManager(bunRoot)).resolves.toBe("bun");
|
||||
|
||||
const legacyBunRoot = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-detect-pm-"));
|
||||
await fs.writeFile(path.join(legacyBunRoot, "bun.lockb"), "", "utf8");
|
||||
await expect(detectPackageManager(legacyBunRoot)).resolves.toBe("bun");
|
||||
|
||||
const npmRoot = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-detect-pm-"));
|
||||
await fs.writeFile(
|
||||
path.join(npmRoot, "package.json"),
|
||||
|
||||
@@ -19,7 +19,7 @@ export async function detectPackageManager(root: string): Promise<DetectedPackag
|
||||
if (files.includes("pnpm-lock.yaml")) {
|
||||
return "pnpm";
|
||||
}
|
||||
if (files.includes("bun.lockb")) {
|
||||
if (files.includes("bun.lock") || files.includes("bun.lockb")) {
|
||||
return "bun";
|
||||
}
|
||||
if (files.includes("package-lock.json")) {
|
||||
|
||||
Reference in New Issue
Block a user