repo-tools: Log stdout content when help markers missing

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
This commit is contained in:
Patrik Oldsberg
2026-02-27 10:21:09 +01:00
parent b7c9a8df12
commit 3a1054f51d
+8 -6
View File
@@ -53,13 +53,15 @@ export function createBinRunner(cwd: string, path: string) {
const fileSize = statSync(outPath).size;
const stdout = readFileSync(outPath, 'utf8');
// Temporary debug: log when file redirect produces no output
if (stdout.length === 0) {
// Temporary debug: log stdout when no help markers found
if (!stdout.includes('Usage:') && !stdout.includes('USAGE:')) {
console.error(
`[createBinRunner debug] empty stdout for: node ${args.join(' ')} ` +
`(exit=${result.status}, fileSize=${fileSize}, stderr=${(
result.stderr?.toString() ?? ''
).slice(0, 200)})`,
`[createBinRunner debug] no help markers for: node ${args.join(
' ',
)} ` +
`(exit=${result.status}, size=${fileSize}, content=${JSON.stringify(
stdout.slice(0, 300),
)})`,
);
}