create-allwright 0.1.25 → 0.1.26
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/dist/index.js +11 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -542,8 +542,18 @@ async function detectPackageManager(targetDir) {
|
|
|
542
542
|
}
|
|
543
543
|
async function installDependencies(targetDir, packageManager) {
|
|
544
544
|
p.log.step(`Installing dependencies with ${packageManager}...`);
|
|
545
|
+
// Package managers installed on Windows are exposed through .cmd shims. Node
|
|
546
|
+
// cannot execute those shims directly, so run the fixed install command via
|
|
547
|
+
// cmd.exe instead. Spawning cmd.exe explicitly also avoids `shell: true`,
|
|
548
|
+
// which is deprecated when arguments are passed separately.
|
|
549
|
+
const command = process.platform === "win32"
|
|
550
|
+
? process.env.ComSpec || "cmd.exe"
|
|
551
|
+
: packageManager;
|
|
552
|
+
const args = process.platform === "win32"
|
|
553
|
+
? ["/d", "/s", "/c", `${packageManager} install`]
|
|
554
|
+
: ["install"];
|
|
545
555
|
await new Promise((resolve, reject) => {
|
|
546
|
-
const child = spawn(
|
|
556
|
+
const child = spawn(command, args, {
|
|
547
557
|
cwd: targetDir,
|
|
548
558
|
stdio: "inherit",
|
|
549
559
|
});
|