(path string, plugin configv3.Plugin)
| 153 | } |
| 154 | |
| 155 | func (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 | |
| 179 | func makeTempFile(tempDir string) (*os.File, error) { |
| 180 | tempFile, err := os.CreateTemp(tempDir, "") |
nothing calls this directly
no test coverage detected