MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / InstallInstruction

Function InstallInstruction

internal/entities/apps.go:340–349  ·  view source on GitHub ↗

InstallInstruction writes the instruction entity's content to the target path determined by app and level. For user-level installs the path is resolved under the user's home directory. For project-level installs the projectDir must point to an existing directory; the path is resolved relative to i

(entity Entity, app string, level InstallLevel, projectDir string)

Source from the content-addressed store, hash-verified

338// projectDir must point to an existing directory; the path is resolved
339// relative to it.
340func InstallInstruction(entity Entity, app string, level InstallLevel, projectDir string) (string, error) {
341 dest, err := InstructionPath(app, level, projectDir)
342 if err != nil {
343 return "", err
344 }
345 if err := writeFile(dest, []byte(entity.Content), 0o600); err != nil {
346 return "", err
347 }
348 return dest, nil
349}
350
351// UninstallInstruction resolves the instruction file for the given app and
352// level and reports whether it exists. Instruction files are app-wide guidance

Calls 2

InstructionPathFunction · 0.85
writeFileFunction · 0.70