Skip to content

Commit 19faf1a

Browse files
committed
Fix exec error handling to ensure stderr and stdout are converted to strings
1 parent 088bfc2 commit 19faf1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ export const executeCommand = async (cmd: string, options: ExecOptions = {}): Pr
129129
exec(cmd, options, (error, stdout, stderr) => {
130130
if (error) {
131131
// Command failed with non-zero exit code
132-
reject(`exec error: ${error}${stderr ? `\nstderr: ${stderr}` : ''}`);
132+
reject(`exec error: ${error}${stderr ? `\nstderr: ${stderr.toString()}` : ''}`);
133133
} else {
134134
// Command succeeded (exit code 0), return stdout
135135
// Note: Many tools like brew send informational messages to stderr even on success
136-
resolve(stdout);
136+
resolve(stdout.toString());
137137
}
138138
});
139139
});

0 commit comments

Comments
 (0)