adminforth 2.4.0-next.7 → 2.4.0-next.9
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.
|
@@ -285,20 +285,21 @@ async function writeTemplateFiles(dirname, cwd, options) {
|
|
|
285
285
|
|
|
286
286
|
async function installDependencies(ctx, cwd) {
|
|
287
287
|
const isWindows = process.platform === 'win32';
|
|
288
|
-
|
|
289
|
-
|
|
288
|
+
|
|
290
289
|
const nodeBinary = process.execPath;
|
|
291
|
-
const npmPath = path.join(path.dirname(nodeBinary),
|
|
292
|
-
|
|
293
|
-
// Quote paths if they contain spaces to handle paths like "C:\Program Files\nodejs\"
|
|
294
|
-
const quotedNodeBinary = nodeBinary.includes(' ') ? `"${nodeBinary}"` : nodeBinary;
|
|
295
|
-
const quotedNpmPath = npmPath.includes(' ') ? `"${npmPath}"` : npmPath;
|
|
296
|
-
|
|
290
|
+
const npmPath = path.join(path.dirname(nodeBinary), 'npm');
|
|
297
291
|
const customDir = ctx.customDir;
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
292
|
+
if (isWindows) {
|
|
293
|
+
const res = await Promise.all([
|
|
294
|
+
await execAsync(`npm install`, { cwd, env: { PATH: process.env.PATH } }),
|
|
295
|
+
await execAsync(`npm install`, { cwd: customDir, env: { PATH: process.env.PATH } }),
|
|
296
|
+
]);
|
|
297
|
+
} else {
|
|
298
|
+
const res = await Promise.all([
|
|
299
|
+
await execAsync(`${nodeBinary} ${npmPath} install`, { cwd, env: { PATH: process.env.PATH } }),
|
|
300
|
+
await execAsync(`${nodeBinary} ${npmPath} install`, { cwd: customDir, env: { PATH: process.env.PATH } }),
|
|
301
|
+
]);
|
|
302
|
+
}
|
|
302
303
|
// console.log(chalk.dim(`Dependencies installed in ${cwd} and ${customDir}: \n${res[0].stdout}${res[1].stdout}`));
|
|
303
304
|
}
|
|
304
305
|
|