cli-five 0.2.4 → 0.2.5
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/package.json +1 -1
- package/src/steps/skills.mjs +9 -11
package/package.json
CHANGED
package/src/steps/skills.mjs
CHANGED
|
@@ -375,22 +375,20 @@ function runSkills(env, skillsArgs, cwd) {
|
|
|
375
375
|
function runSkillsTracked(env, skillsArgs, cwd) {
|
|
376
376
|
const { cmd, args } = env.runner(skillsArgs);
|
|
377
377
|
return new Promise((resolve) => {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
});
|
|
378
|
+
// stdout/stderr inherit so the child writes directly to the TTY.
|
|
379
|
+
// This prevents line-buffering from swallowing unterminated prompt lines
|
|
380
|
+
// (e.g. the global vs local install question from the skills CLI).
|
|
381
|
+
// Failure is detected via exit code; stderr still captured for reason extraction.
|
|
382
|
+
let stderrOutput = '';
|
|
383
|
+
const proc = spawn(cmd, args, { cwd, stdio: ['inherit', 'inherit', 'pipe'] });
|
|
385
384
|
proc.stderr.on('data', (chunk) => {
|
|
386
385
|
const text = chunk.toString();
|
|
387
386
|
process.stderr.write(text);
|
|
388
|
-
|
|
387
|
+
stderrOutput += text;
|
|
389
388
|
});
|
|
390
389
|
proc.on('exit', (code) => {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
const reason = extractFailureReason(clean);
|
|
390
|
+
if (code !== 0) {
|
|
391
|
+
const reason = extractFailureReason(stripAnsi(stderrOutput)) || `exited with code ${code}`;
|
|
394
392
|
resolve({ ok: false, reason });
|
|
395
393
|
} else {
|
|
396
394
|
resolve({ ok: true, reason: null });
|