ma-agents 3.6.1 → 3.6.2
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.
- package/lib/bmad.js +10 -6
- package/package.json +1 -1
package/lib/bmad.js
CHANGED
|
@@ -32,18 +32,22 @@ const CONFIG_DIR = path.join(BMAD_DIR, '_config', 'agents');
|
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Run a shell command, relaying output to stdout/stderr.
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* Always uses pipe mode so that on failure, error.stdout and error.stderr
|
|
36
|
+
* are populated — enabling classifyRecompileFailure to detect EBUSY and
|
|
37
|
+
* other subprocess errors by inspecting their text.
|
|
38
|
+
* Output is manually relayed to the terminal on success; on failure the
|
|
39
|
+
* subprocess output is relayed before rethrowing so the user still sees it.
|
|
38
40
|
*/
|
|
39
41
|
function runCommand(command, options = {}) {
|
|
40
|
-
|
|
42
|
+
try {
|
|
41
43
|
const result = execSync(command, { ...options, stdio: 'pipe' });
|
|
42
44
|
if (result && result.length > 0) {
|
|
43
45
|
process.stdout.write(result);
|
|
44
46
|
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
+
} catch (err) {
|
|
48
|
+
if (err.stdout && err.stdout.length > 0) process.stdout.write(err.stdout);
|
|
49
|
+
if (err.stderr && err.stderr.length > 0) process.stderr.write(err.stderr);
|
|
50
|
+
throw err;
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
53
|
|