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

Function openFileAtPath

cli/src/utils/open-file.ts:127–146  ·  view source on GitHub ↗
(
  filePath: string,
  env: CliEnv = getCliEnv(),
)

Source from the content-addressed store, hash-verified

125}
126
127export const openFileAtPath = async (
128 filePath: string,
129 env: CliEnv = getCliEnv(),
130): Promise<boolean> => {
131 const commands = buildEditorCommands(filePath, env)
132
133 for (const command of commands) {
134 // eslint-disable-next-line no-await-in-loop
135 const success = await runCommand(command)
136 if (success) {
137 return true
138 }
139 }
140
141 logger.warn(
142 { filePath, commands },
143 'Failed to open file with any configured editor command',
144 )
145 return false
146}

Callers 2

AppFunction · 0.90
ValidationErrorPopoverFunction · 0.90

Calls 3

getCliEnvFunction · 0.90
buildEditorCommandsFunction · 0.85
runCommandFunction · 0.70

Tested by

no test coverage detected