MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / replaceFilePlaceholder

Function replaceFilePlaceholder

cli/src/utils/open-file.ts:18–26  ·  view source on GitHub ↗
(command: string, filePath: string)

Source from the content-addressed store, hash-verified

16 `"${value.replace(/"/g, '""')}"`
17
18const replaceFilePlaceholder = (command: string, filePath: string): string => {
19 if (command.includes('%f')) {
20 return command.replace(/%f/g, filePath)
21 }
22 if (command.includes('{file}')) {
23 return command.replace(/{file}/g, filePath)
24 }
25 return command
26}
27
28const buildEditorCommands = (
29 filePath: string,

Callers 1

buildEditorCommandsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected