( targetPath: string )
| 271 | } |
| 272 | |
| 273 | async function detectPackageManager( |
| 274 | targetPath: string |
| 275 | ): Promise<"npm" | "yarn" | "pnpm"> { |
| 276 | if (await fs.pathExists(path.join(targetPath, "yarn.lock"))) { |
| 277 | return "yarn"; |
| 278 | } |
| 279 | if (await fs.pathExists(path.join(targetPath, "pnpm-lock.yaml"))) { |
| 280 | return "pnpm"; |
| 281 | } |
| 282 | return "npm"; |
| 283 | } |
| 284 | |
| 285 | function getInstallCommand( |
| 286 | packageManager: "npm" | "yarn" | "pnpm", |