adminforth 3.6.9 → 3.6.10
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 +38 -24
- package/package.json +1 -1
|
@@ -487,32 +487,42 @@ async function writeTemplateFiles(dirname, cwd, useNpm, includePrismaMigrations,
|
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
|
|
490
|
-
async function
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
490
|
+
async function installDependenciesPnpm(ctx, cwd) {
|
|
491
|
+
const isWindows = process.platform === 'win32';
|
|
492
|
+
|
|
493
|
+
const nodeBinary = process.execPath;
|
|
494
|
+
const pnpmPath = path.join(path.dirname(nodeBinary), isWindows ? 'pnpm.cmd' : 'pnpm');
|
|
495
|
+
const customDir = ctx.customDir;
|
|
496
|
+
if (isWindows) {
|
|
497
|
+
const res = await Promise.all([
|
|
498
|
+
execAsync(`pnpm install`, { cwd, env: { PATH: process.env.PATH } }),
|
|
499
|
+
execAsync(`pnpm install`, { cwd: customDir, env: { PATH: process.env.PATH } }),
|
|
500
|
+
]);
|
|
501
|
+
} else {
|
|
502
|
+
const res = await Promise.all([
|
|
503
|
+
execAsync(`${nodeBinary} ${pnpmPath} install`, { cwd, env: { PATH: process.env.PATH } }),
|
|
504
|
+
execAsync(`${nodeBinary} ${pnpmPath} install`, { cwd: customDir, env: { PATH: process.env.PATH } }),
|
|
505
|
+
]);
|
|
505
506
|
}
|
|
506
507
|
}
|
|
507
508
|
|
|
508
|
-
async function
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
509
|
+
async function installDependenciesNpm(ctx, cwd) {
|
|
510
|
+
const isWindows = process.platform === 'win32';
|
|
511
|
+
|
|
512
|
+
const nodeBinary = process.execPath;
|
|
513
|
+
const npmPath = path.join(path.dirname(nodeBinary), isWindows ? 'npm.cmd' : 'npm');
|
|
514
|
+
const customDir = ctx.customDir;
|
|
515
|
+
if (isWindows) {
|
|
516
|
+
const res = await Promise.all([
|
|
517
|
+
execAsync(`npm install`, { cwd, env: { PATH: process.env.PATH } }),
|
|
518
|
+
execAsync(`npm install`, { cwd: customDir, env: { PATH: process.env.PATH } }),
|
|
519
|
+
]);
|
|
520
|
+
} else {
|
|
521
|
+
const res = await Promise.all([
|
|
522
|
+
execAsync(`${nodeBinary} ${npmPath} install`, { cwd, env: { PATH: process.env.PATH } }),
|
|
523
|
+
execAsync(`${nodeBinary} ${npmPath} install`, { cwd: customDir, env: { PATH: process.env.PATH } }),
|
|
524
|
+
]);
|
|
525
|
+
}
|
|
516
526
|
}
|
|
517
527
|
|
|
518
528
|
function generateFinalInstructionsPnpm(skipPrismaSetup, options) {
|
|
@@ -586,7 +596,11 @@ export function prepareWorkflow(options) {
|
|
|
586
596
|
{
|
|
587
597
|
title: '📦 Installing dependencies...',
|
|
588
598
|
task: async (ctx) => {
|
|
589
|
-
|
|
599
|
+
if (options.useNpm) {
|
|
600
|
+
await installDependenciesNpm(ctx, ctx.projectDir);
|
|
601
|
+
} else {
|
|
602
|
+
await installDependenciesPnpm(ctx, ctx.projectDir);
|
|
603
|
+
}
|
|
590
604
|
}
|
|
591
605
|
},
|
|
592
606
|
{
|