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

Function isAlreadyInstalled

internal/cli/management.go:2076–2091  ·  view source on GitHub ↗

isAlreadyInstalled checks whether the named entity is already installed for the given app.

(name string, kind entities.Kind, app string)

Source from the content-addressed store, hash-verified

2074
2075// isAlreadyInstalled checks whether the named entity is already installed for the given app.
2076func isAlreadyInstalled(name string, kind entities.Kind, app string) bool {
2077 apps := entities.AppPathsFor(kind)
2078 dest, ok := apps[app]
2079 if !ok {
2080 return false
2081 }
2082 resolved := expandPath(dest)
2083 switch kind {
2084 case entities.KindPrompt, entities.KindInstruction:
2085 _, err := os.Stat(resolved)
2086 return err == nil
2087 default:
2088 _, err := os.Stat(filepath.Join(resolved, name))
2089 return err == nil
2090 }
2091}
2092
2093// ============================================================================
2094// uninstall — remove from code agent(s)

Callers 4

installOneFromStoreFunction · 0.85
installAllFromStoreFunction · 0.85
installFromLocalFunction · 0.85
installFromGitHubFunction · 0.85

Calls 2

AppPathsForFunction · 0.92
expandPathFunction · 0.85

Tested by

no test coverage detected