1
0
This commit is contained in:
Zef Hemel 2023-12-17 15:13:00 +01:00
parent 0964775517
commit 7bd58ae0e8

View File

@ -1,3 +1,4 @@
import { ShellResponse } from "../../server/rpc.ts";
import type { SysCallMapping } from "../system.ts";
export function shellSyscalls(cwd: string): SysCallMapping {
@ -6,7 +7,7 @@ export function shellSyscalls(cwd: string): SysCallMapping {
_ctx,
cmd: string,
args: string[],
): Promise<{ stdout: string; stderr: string }> => {
): Promise<ShellResponse> => {
const p = new Deno.Command(cmd, {
args: args,
cwd,
@ -17,7 +18,7 @@ export function shellSyscalls(cwd: string): SysCallMapping {
const stdout = new TextDecoder().decode(output.stdout);
const stderr = new TextDecoder().decode(output.stderr);
return { stdout, stderr };
return { stdout, stderr, code: output.code };
},
};
}