MCPcopy Index your code
hub / github.com/devspace-sh/devspace / Add

Method Add

pkg/devspace/plugin/plugin.go:78–96  ·  view source on GitHub ↗
(path, version string)

Source from the content-addressed store, hash-verified

76}
77
78func (c *client) Add(path, version string) (*Metadata, error) {
79 // resolve path if it's a local one
80 var err error
81 if isLocalReference(path) {
82 path, err = filepath.Abs(path)
83 if err != nil {
84 return nil, err
85 }
86 }
87
88 metadata, err := c.Get(path)
89 if err != nil {
90 return nil, err
91 } else if metadata != nil {
92 return nil, fmt.Errorf("plugin %s already exists", path)
93 }
94
95 return c.install(path, version)
96}
97
98func (c *client) install(path, version string) (*Metadata, error) {
99 metadata, err := c.installer.DownloadMetadata(path, version)

Callers

nothing calls this directly

Calls 4

GetMethod · 0.95
installMethod · 0.95
isLocalReferenceFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected