create-allwright 0.1.25 → 0.1.27

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -1
  2. 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(packageManager, ["install"], {
556
+ const child = spawn(command, args, {
547
557
  cwd: targetDir,
548
558
  stdio: "inherit",
549
559
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-allwright",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "description": "Create a new allwright test project with npm init allwright.",
5
5
  "license": "MIT",
6
6
  "type": "module",