Fixes shell/fetch regression
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { HttpSpacePrimitives } from "../../common/spaces/http_space_primitives.ts";
|
||||
import { SysCallMapping } from "../../plugos/system.ts";
|
||||
import type { Client } from "../client.ts";
|
||||
|
||||
export function shellSyscalls(
|
||||
httpSpacePrimitives?: HttpSpacePrimitives,
|
||||
client: Client,
|
||||
): SysCallMapping {
|
||||
return {
|
||||
"shell.run": async (
|
||||
@@ -10,11 +10,11 @@ export function shellSyscalls(
|
||||
cmd: string,
|
||||
args: string[],
|
||||
): Promise<{ stdout: string; stderr: string; code: number }> => {
|
||||
if (!httpSpacePrimitives) {
|
||||
if (!client.remoteSpacePrimitives) {
|
||||
throw new Error("Not supported in fully local mode");
|
||||
}
|
||||
const resp = httpSpacePrimitives.authenticatedFetch(
|
||||
`${httpSpacePrimitives.url}/.rpc`,
|
||||
const resp = client.remoteSpacePrimitives.authenticatedFetch(
|
||||
`${client.remoteSpacePrimitives.url}/.rpc`,
|
||||
{
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user