Skip to content

Commit 356bc82

Browse files
authored
Add optional stdin to shell syscall (#1885)
1 parent a01b91b commit 356bc82

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plug-api/syscalls/shell.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ import { syscall } from "../syscall.ts";
44
* Runs a shell command.
55
* @param cmd the command to run
66
* @param args the arguments to pass to the command
7+
* @param stdin optional string to pass as stdin to the command
78
* @returns the stdout, stderr, and exit code of the command
89
*/
910
export function run(
1011
cmd: string,
1112
args: string[],
13+
stdin?: string,
1214
): Promise<{ stdout: string; stderr: string; code: number }> {
13-
return syscall("shell.run", cmd, args);
15+
return syscall("shell.run", cmd, args, stdin);
1416
}
17+

0 commit comments

Comments
 (0)