Snapshot
This commit is contained in:
parent
0964775517
commit
7bd58ae0e8
@ -1,3 +1,4 @@
|
|||||||
|
import { ShellResponse } from "../../server/rpc.ts";
|
||||||
import type { SysCallMapping } from "../system.ts";
|
import type { SysCallMapping } from "../system.ts";
|
||||||
|
|
||||||
export function shellSyscalls(cwd: string): SysCallMapping {
|
export function shellSyscalls(cwd: string): SysCallMapping {
|
||||||
@ -6,7 +7,7 @@ export function shellSyscalls(cwd: string): SysCallMapping {
|
|||||||
_ctx,
|
_ctx,
|
||||||
cmd: string,
|
cmd: string,
|
||||||
args: string[],
|
args: string[],
|
||||||
): Promise<{ stdout: string; stderr: string }> => {
|
): Promise<ShellResponse> => {
|
||||||
const p = new Deno.Command(cmd, {
|
const p = new Deno.Command(cmd, {
|
||||||
args: args,
|
args: args,
|
||||||
cwd,
|
cwd,
|
||||||
@ -17,7 +18,7 @@ export function shellSyscalls(cwd: string): SysCallMapping {
|
|||||||
const stdout = new TextDecoder().decode(output.stdout);
|
const stdout = new TextDecoder().decode(output.stdout);
|
||||||
const stderr = new TextDecoder().decode(output.stderr);
|
const stderr = new TextDecoder().decode(output.stderr);
|
||||||
|
|
||||||
return { stdout, stderr };
|
return { stdout, stderr, code: output.code };
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user