MCPcopy Create free account
hub / github.com/pingdotgg/t3code / extractPathFromShellOutput

Function extractPathFromShellOutput

packages/shared/src/shell.ts:181–191  ·  view source on GitHub ↗
(output: string)

Source from the content-addressed store, hash-verified

179}
180
181export function extractPathFromShellOutput(output: string): string | null {
182 const startIndex = output.indexOf(PATH_CAPTURE_START);
183 if (startIndex === -1) return null;
184
185 const valueStartIndex = startIndex + PATH_CAPTURE_START.length;
186 const endIndex = output.indexOf(PATH_CAPTURE_END, valueStartIndex);
187 if (endIndex === -1) return null;
188
189 const pathValue = output.slice(valueStartIndex, endIndex).trim();
190 return pathValue.length > 0 ? pathValue : null;
191}
192
193export function readPathFromLoginShell(
194 shell: string,

Callers 1

shell.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected