MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / main

Function main

pkg/go/cmd/codebase-memory-mcp/main.go:110–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108)
109
110func main() {
111 mutation := runtimeMutationAction(os.Args[1:])
112 if mutation == "update" {
113 fmt.Fprintln(
114 os.Stderr,
115 "This Go wrapper is maintained by Go. Update it with \"go install github.com/DeusData/codebase-memory-mcp/pkg/go/cmd/codebase-memory-mcp@latest\".",
116 )
117 os.Exit(2)
118 }
119 executable, err := ensureBinary()
120 if err != nil {
121 fmt.Fprintf(os.Stderr, "codebase-memory-mcp: %v\n", err)
122 os.Exit(1)
123 }
124 args := nativeArgs(os.Args[1:])
125 if mutation == "install" || mutation == "uninstall" {
126 err = execBinaryWithRuntimeLock(executable, args)
127 } else {
128 err = execBinary(executable, args)
129 }
130 if err != nil {
131 if runtime.GOOS == "windows" {
132 var exitErr *exec.ExitError
133 if errors.As(err, &exitErr) {
134 printPortableMutationGuidance(args)
135 os.Exit(exitErr.ExitCode())
136 }
137 }
138 fmt.Fprintf(os.Stderr, "codebase-memory-mcp: %v\n", err)
139 os.Exit(1)
140 }
141}
142
143func ensureBinary() (string, error) {
144 binary := binPath()

Callers 1

__main__.pyFile · 0.90

Calls 6

runtimeMutationActionFunction · 0.85
ensureBinaryFunction · 0.85
nativeArgsFunction · 0.85
execBinaryFunction · 0.85

Tested by

no test coverage detected