MCPcopy Create free account
hub / github.com/disler/pi-vs-claude-code / commandReferencesPath

Function commandReferencesPath

extensions/damage-control-continue.ts:76–85  ·  view source on GitHub ↗
(command: string, protectedPath: string)

Source from the content-addressed store, hash-verified

74 }
75
76 function commandReferencesPath(command: string, protectedPath: string): boolean {
77 if (!protectedPath) return false;
78 let idx = command.indexOf(protectedPath);
79 while (idx >= 0) {
80 const after = command[idx + protectedPath.length];
81 if (!after || !/[A-Za-z0-9_-]/.test(after)) return true;
82 idx = command.indexOf(protectedPath, idx + 1);
83 }
84 return false;
85 }
86
87 function isPathMatch(targetPath: string, pattern: string, cwd: string): boolean {
88 const resolvedPattern = pattern.startsWith("~") ? path.join(os.homedir(), pattern.slice(1)) : pattern;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected