MCPcopy Index your code
hub / github.com/cloudfoundry/cli / installPlugin

Method installPlugin

cf/commands/plugin/install_plugin.go:273–292  ·  view source on GitHub ↗
(pluginMetadata *plugin.PluginMetadata, pluginDestinationFilepath, pluginSourceFilepath string)

Source from the content-addressed store, hash-verified

271}
272
273func (cmd *PluginInstall) installPlugin(pluginMetadata *plugin.PluginMetadata, pluginDestinationFilepath, pluginSourceFilepath string) error {
274 err := fileutils.CopyPathToPath(pluginSourceFilepath, pluginDestinationFilepath)
275 if err != nil {
276 return errors.New(T(
277 "Could not copy plugin binary: \n{{.Error}}",
278 map[string]interface{}{
279 "Error": err.Error(),
280 }),
281 )
282 }
283
284 configMetadata := pluginconfig.PluginMetadata{
285 Location: pluginDestinationFilepath,
286 Version: pluginMetadata.Version,
287 Commands: pluginMetadata.Commands,
288 }
289
290 cmd.pluginConfig.SetPlugin(pluginMetadata.Name, configMetadata)
291 return nil
292}
293
294func (cmd *PluginInstall) runBinaryAndObtainPluginMetadata(pluginSourceFilepath string) (*plugin.PluginMetadata, error) {
295 err := cmd.rpcService.Start()

Callers 1

ExecuteMethod · 0.95

Calls 2

ErrorMethod · 0.65
SetPluginMethod · 0.65

Tested by

no test coverage detected