Skip to content

Commit

Permalink
add buffer to handle shell output
Browse files Browse the repository at this point in the history
  • Loading branch information
HBobertz committed Jan 13, 2025
1 parent da98322 commit c510731
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/private/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,16 @@ export async function shell(command: string[], options: ShellOptions): Promise<s
});
}

function handleShellOutput(chunk: string, options: ShellOptions, eventType: ShellEventType): void {
function handleShellOutput(
chunk: Buffer | string,
options: ShellOptions,
eventType: ShellEventType
): void {
switch (options.subprocessOutputDestination) {
case 'ignore':
return;
case 'publish':
options.shellEventPublisher(eventType, chunk);
options.shellEventPublisher(eventType, chunk.toString('utf-8'));
break;
case 'stdio':
default:
Expand Down

0 comments on commit c510731

Please sign in to comment.