@lexibase/create-rdx 1.0.0-beta.0 → 1.0.0-beta.1

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/bin/index.js +14 -1
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -37,7 +37,20 @@ function validateProjectName(projectName) {
37
37
 
38
38
  function run(command, args, cwd) {
39
39
  return new Promise((resolve, reject) => {
40
- const child = spawn(command, args, { cwd, stdio: 'inherit' })
40
+ // Reuse the package manager's Node entry point, including on Windows,
41
+ // where a .cmd shim cannot be launched directly with spawn().
42
+ const packageManagerEntry = process.env.npm_execpath
43
+ const useNodeEntry =
44
+ command === getPackageManager() &&
45
+ packageManagerEntry &&
46
+ /\.[cm]?js$/i.test(packageManagerEntry)
47
+ const executable = useNodeEntry ? process.execPath : command
48
+ const commandArgs = useNodeEntry ? [packageManagerEntry, ...args] : args
49
+ const child = spawn(executable, commandArgs, {
50
+ cwd,
51
+ stdio: 'inherit',
52
+ shell: !useNodeEntry && process.platform === 'win32',
53
+ })
41
54
 
42
55
  child.on('error', reject)
43
56
  child.on('exit', (code) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexibase/create-rdx",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0-beta.1",
4
4
  "description": "Create a new RDX documentation project.",
5
5
  "license": "MIT",
6
6
  "bin": {