From 4d153c35da64c0630fdbd5e3f94ac16d4fea703e Mon Sep 17 00:00:00 2001 From: majiayu000 <1835304752@qq.com> Date: Sat, 21 Mar 2026 19:53:58 +0800 Subject: [PATCH] fix: use execFileSync to preserve spaces in CLI arguments Replace execSync with execFileSync in npx wrapper so that argument values containing spaces (e.g. --user-name "CI Bot") are passed as discrete array elements instead of being split by the shell. Fixes #2066 Signed-off-by: majiayu000 <1835304752@qq.com> --- tools/bmad-npx-wrapper.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/bmad-npx-wrapper.js b/tools/bmad-npx-wrapper.js index bc63a4121..c6f578b2d 100755 --- a/tools/bmad-npx-wrapper.js +++ b/tools/bmad-npx-wrapper.js @@ -5,7 +5,7 @@ * This file ensures proper execution when run via npx from GitHub or npm registry */ -const { execSync } = require('node:child_process'); +const { execFileSync } = require('node:child_process'); const path = require('node:path'); const fs = require('node:fs'); @@ -25,7 +25,7 @@ if (isNpxExecution) { try { // Execute CLI from user's working directory (process.cwd()), not npm cache - execSync(`node "${bmadCliPath}" ${args.join(' ')}`, { + execFileSync('node', [bmadCliPath, ...args], { stdio: 'inherit', cwd: process.cwd(), // This preserves the user's working directory });