Merge pull request #1355 from trheyi/main
Enhance MCP loading functionality by checking for directory existence
This commit is contained in:
commit
fbfb1271d8
1 changed files with 7 additions and 1 deletions
|
|
@ -617,8 +617,14 @@ func loadConnector(t *testing.T, cfg config.Config) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func loadMCP(t *testing.T, cfg config.Config) {
|
func loadMCP(t *testing.T, cfg config.Config) {
|
||||||
|
// Check if mcps directory exists
|
||||||
|
exists, err := application.App.Exists("mcps")
|
||||||
|
if err != nil || !exists {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
exts := []string{"*.mcp.yao", "*.mcp.json", "*.mcp.jsonc"}
|
exts := []string{"*.mcp.yao", "*.mcp.json", "*.mcp.jsonc"}
|
||||||
err := application.App.Walk("mcps", func(root, file string, isdir bool) error {
|
err = application.App.Walk("mcps", func(root, file string, isdir bool) error {
|
||||||
if isdir {
|
if isdir {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue