From e4a659b2693bef9cc37aff6d1f539b8ce3bceb76 Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Sat, 1 Nov 2025 10:24:55 -0500 Subject: [PATCH] fix: write logs to stderr to avoid interfering with piped output Change log() function to use console.error instead of console.log. This ensures that when stdout is piped (e.g., to 'code -'), only the prompt file path is sent through the pipe, while progress messages remain visible on the terminal via stderr. Usage: echo 'content' | yarn --silent docs:create --products X | code - --- scripts/docs-create.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/docs-create.js b/scripts/docs-create.js index aa7a0d799..1cbdeb187 100644 --- a/scripts/docs-create.js +++ b/scripts/docs-create.js @@ -55,10 +55,11 @@ const colors = { }; /** - * Print colored output + * Print colored output to stderr (so it doesn't interfere with piped output) */ function log(message, color = 'reset') { - console.log(`${colors[color]}${message}${colors.reset}`); + // Write to stderr so logs don't interfere with stdout (prompt path/text) + console.error(`${colors[color]}${message}${colors.reset}`); } /**