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

Method InstallPluginFromPath

actor/pluginaction/install.go:155–177  ·  view source on GitHub ↗
(path string, plugin configv3.Plugin)

Source from the content-addressed store, hash-verified

153}
154
155func (actor Actor) InstallPluginFromPath(path string, plugin configv3.Plugin) error {
156 installPath := generic.ExecutableFilename(filepath.Join(actor.config.PluginHome(), plugin.Name))
157 err := fileutils.CopyPathToPath(path, installPath)
158 if err != nil {
159 return err
160 }
161 // rwxr-xr-x so that multiple users can share the same $CF_PLUGIN_HOME
162 err = os.Chmod(installPath, 0755)
163 if err != nil {
164 return err
165 }
166
167 plugin.Location = installPath
168
169 actor.config.AddPlugin(plugin)
170
171 err = actor.config.WritePluginConfig()
172 if err != nil {
173 return err
174 }
175
176 return nil
177}
178
179func makeTempFile(tempDir string) (*os.File, error) {
180 tempFile, err := os.CreateTemp(tempDir, "")

Callers

nothing calls this directly

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 4

ExecutableFilenameFunction · 0.92
PluginHomeMethod · 0.65
AddPluginMethod · 0.65
WritePluginConfigMethod · 0.65

Tested by

no test coverage detected