bmad-fh 6.0.0-alpha.23.96db56c9 → 6.0.0-alpha.23.b9802f7d

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.
@@ -5,7 +5,7 @@
5
5
  * This file ensures proper execution when run via npx from GitHub or npm registry
6
6
  */
7
7
 
8
- const { execSync } = require('node:child_process');
8
+ const { spawnSync } = require('node:child_process');
9
9
  const path = require('node:path');
10
10
  const fs = require('node:fs');
11
11
 
@@ -25,10 +25,20 @@ if (isNpxExecution) {
25
25
 
26
26
  try {
27
27
  // Execute CLI from user's working directory (process.cwd()), not npm cache
28
- execSync(`node "${bmadCliPath}" ${args.join(' ')}`, {
28
+ // Use spawnSync with array args to preserve argument boundaries
29
+ // (args.join(' ') would break arguments containing spaces)
30
+ const result = spawnSync('node', [bmadCliPath, ...args], {
29
31
  stdio: 'inherit',
30
32
  cwd: process.cwd(), // This preserves the user's working directory
31
33
  });
34
+
35
+ if (result.error) {
36
+ throw result.error;
37
+ }
38
+
39
+ if (result.status !== 0) {
40
+ process.exit(result.status || 1);
41
+ }
32
42
  } catch (error) {
33
43
  process.exit(error.status || 1);
34
44
  }
@@ -45,6 +45,11 @@ for (const [name, cmd] of Object.entries(commands)) {
45
45
  command.option(...option);
46
46
  }
47
47
 
48
+ // Allow commands to configure themselves (e.g., custom help)
49
+ if (cmd.configureCommand) {
50
+ cmd.configureCommand(command);
51
+ }
52
+
48
53
  // Set action
49
54
  command.action(cmd.action);
50
55
  }