Rebranded plugbox to PlugOS (plugos)

This commit is contained in:
Zef Hemel
2022-03-27 11:31:12 +02:00
parent 621e55dbcf
commit cb809d2d03
45 changed files with 42 additions and 51 deletions
+20
View File
@@ -0,0 +1,20 @@
import { promisify } from "util";
import { execFile } from "child_process";
import type { SysCallMapping } from "../system";
const execFilePromise = promisify(execFile);
export default function (cwd: string): SysCallMapping {
return {
run: async (
ctx,
cmd: string,
args: string[]
): Promise<{ stdout: string; stderr: string }> => {
let { stdout, stderr } = await execFilePromise(cmd, args, {
cwd: cwd,
});
return { stdout, stderr };
},
};
}