MCPcopy Index your code
hub / github.com/callstack/agent-device / normalizeOverridePath

Function normalizeOverridePath

src/utils/exec.ts:629–644  ·  view source on GitHub ↗
(
  rawPath: string | undefined,
  envName: string,
  kind: 'executable' | 'file',
)

Source from the content-addressed store, hash-verified

627}
628
629function normalizeOverridePath(
630 rawPath: string | undefined,
631 envName: string,
632 kind: 'executable' | 'file',
633): string | undefined {
634 const candidate = rawPath?.trim();
635 if (!candidate) return undefined;
636 if (!path.isAbsolute(candidate) || candidate.includes('\0')) {
637 throw new AppError(
638 'INVALID_ARGS',
639 `${envName} must be an absolute ${kind} path, not ${JSON.stringify(rawPath)}`,
640 { envName, path: rawPath },
641 );
642 }
643 return candidate;
644}
645
646function normalizeExecutableLookup(cmd: string): string | null {
647 const candidate = cmd.trim();

Callers 2

resolveFileOverridePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected