diff --git a/src/package-manager.ts b/src/package-manager.ts index 6b6dfcd..7f3a6cf 100644 --- a/src/package-manager.ts +++ b/src/package-manager.ts @@ -47,7 +47,7 @@ export const packageManagers: PackageManager[] = [ { name: "bun", command: "bun", - lockFile: "bun.lockb", + lockFile: ["bun.lockb", "bun.lock"], }, { name: "yarn", @@ -109,8 +109,10 @@ export async function detectPackageManager( for (const packageManager of packageManagers) { const detectionsFiles = [ packageManager.lockFile, - ...(packageManager.files || []), - ].filter(Boolean) as string[]; + packageManager.files, + ] + .flat() + .filter(Boolean) as string[]; if (detectionsFiles.some((file) => existsSync(resolve(path, file)))) { return { diff --git a/src/types.ts b/src/types.ts index f70b8d5..b0441a9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -5,7 +5,7 @@ export type PackageManager = { command: string; version?: string; majorVersion?: string; - lockFile?: string; + lockFile?: string | string[]; files?: string[]; };