MCPcopy Index your code
hub / github.com/commitdev/zero / FetchModule

Function FetchModule

internal/module/module.go:21–33  ·  view source on GitHub ↗

FetchModule downloads the remote module source if necessary. Meant to be run in a goroutine.

(source string, wg *sync.WaitGroup)

Source from the content-addressed store, hash-verified

19
20// FetchModule downloads the remote module source if necessary. Meant to be run in a goroutine.
21func FetchModule(source string, wg *sync.WaitGroup) {
22 defer wg.Done()
23
24 localPath := GetSourceDir(source)
25 if !IsLocal(source) {
26 flog.Debugf("Downloading module: %s to %s", source, localPath)
27 err := getter.Get(localPath, source)
28 if err != nil {
29 exit.Fatal("Failed to fetch remote module from %s: %v\n", source, err)
30 }
31 }
32 return
33}
34
35// ParseModuleConfig loads the local config file for a module and parses the yaml
36func ParseModuleConfig(source string) (moduleconfig.ModuleConfig, error) {

Callers 2

loadAllModulesFunction · 0.92
GenerateFunction · 0.92

Calls 4

DebugfFunction · 0.92
FatalFunction · 0.92
GetSourceDirFunction · 0.85
IsLocalFunction · 0.85

Tested by

no test coverage detected