adminforth 3.6.7 → 3.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commands/createApp/utils.js +20 -1
- package/package.json +1 -1
|
@@ -487,8 +487,27 @@ async function writeTemplateFiles(dirname, cwd, useNpm, includePrismaMigrations,
|
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
|
|
490
|
+
async function resolvePackageManagerCommand(packageManager) {
|
|
491
|
+
if (packageManager !== 'pnpm') {
|
|
492
|
+
return packageManager;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
try {
|
|
496
|
+
await execAsync('pnpm --version', { env: process.env });
|
|
497
|
+
return 'pnpm';
|
|
498
|
+
} catch {
|
|
499
|
+
try {
|
|
500
|
+
await execAsync('corepack pnpm --version', { env: process.env });
|
|
501
|
+
return 'corepack pnpm';
|
|
502
|
+
} catch {
|
|
503
|
+
throw new Error('pnpm is not available. Install pnpm globally or enable Corepack before creating a pnpm project.');
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
490
508
|
async function installDependencies(ctx, cwd, packageManager) {
|
|
491
|
-
const
|
|
509
|
+
const packageManagerCommand = await resolvePackageManagerCommand(packageManager);
|
|
510
|
+
const command = `${packageManagerCommand} install`;
|
|
492
511
|
|
|
493
512
|
await Promise.all([
|
|
494
513
|
execAsync(command, { cwd, env: process.env }),
|