mirror of
https://github.com/bmadcode/BMAD-METHOD.git
synced 2025-12-29 16:14:59 +00:00
fix: honor original working directory when running npx installer and searching for task files
(cherry picked from commit 6a5a597fe39bc75379f54bedc1616bfab283dfa1)
This commit is contained in:
@@ -26,9 +26,12 @@ if (isNpxExecution) {
|
||||
}
|
||||
|
||||
try {
|
||||
// Honor the directory where the user invoked npx from
|
||||
const originalCwd = process.env.INIT_CWD || process.env.PWD || process.cwd();
|
||||
execSync(`node "${bmadScriptPath}" ${arguments_.join(' ')}`, {
|
||||
stdio: 'inherit',
|
||||
cwd: path.dirname(__dirname),
|
||||
cwd: originalCwd,
|
||||
env: { ...process.env, BMAD_ORIGINAL_CWD: originalCwd },
|
||||
});
|
||||
} catch (error) {
|
||||
process.exit(error.status || 1);
|
||||
|
||||
Reference in New Issue
Block a user