MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / outputAfter

Function outputAfter

e2e/selfhost/mcp-opencode-consent.test.ts:73–78  ·  view source on GitHub ↗
(text: string, line: string)

Source from the content-addressed store, hash-verified

71 await term.screen.waitForText("$", { timeoutMs: 10_000 });
72
73 const outputAfter = (text: string, line: string): string | null => {
74 const echoed = text.lastIndexOf(line);
75 if (echoed === -1) return null;
76 const after = text.slice(echoed + line.length);
77 return after.trimEnd().endsWith("\n$") ? after : null;
78 };
79 const sh = async (line: string, timeoutMs: number) => {
80 await term.keyboard.type(line);
81 await term.keyboard.press("Enter");

Callers 1

shFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected