MCPcopy Create free account
hub / github.com/astercloud/aster / LoadLocal

Function LoadLocal

pkg/commands/loader.go:125–134  ·  view source on GitHub ↗

LoadLocal 从本地文件系统加载(用于开发)

(baseDir, commandName string)

Source from the content-addressed store, hash-verified

123
124// LoadLocal 从本地文件系统加载(用于开发)
125func LoadLocal(baseDir, commandName string) (*CommandDefinition, error) {
126 path := filepath.Join(baseDir, commandName+".md")
127 content, err := os.ReadFile(path)
128 if err != nil {
129 return nil, fmt.Errorf("read command file: %w", err)
130 }
131
132 loader := &CommandLoader{baseDir: baseDir}
133 return loader.parse(commandName, string(content))
134}

Callers

nothing calls this directly

Calls 3

parseMethod · 0.95
JoinMethod · 0.45
ReadFileMethod · 0.45

Tested by

no test coverage detected