MCPcopy
hub / github.com/whyrusleeping/gx / LoadPackage

Function LoadPackage

gxutil/pm.go:594–614  ·  view source on GitHub ↗
(out interface{}, env, hash string)

Source from the content-addressed store, hash-verified

592}
593
594func LoadPackage(out interface{}, env, hash string) error {
595 VLog(" - load package:", hash)
596 ipath, err := InstallPath(env, "", true)
597 if err != nil {
598 return err
599 }
600
601 p := filepath.Join(ipath, "gx", "ipfs", hash)
602 err = FindPackageInDir(out, p)
603 if err == nil {
604 return nil
605 }
606
607 ipath, err = InstallPath(env, "", false)
608 if err != nil {
609 return err
610 }
611
612 p = filepath.Join(ipath, "gx", "ipfs", hash)
613 return FindPackageInDir(out, p)
614}
615
616var ErrUnrecognizedName = fmt.Errorf("unrecognized package name")
617

Callers 2

enumerateDepsRecMethod · 0.85
ForEachDepMethod · 0.85

Calls 2

InstallPathFunction · 0.85
FindPackageInDirFunction · 0.85

Tested by

no test coverage detected