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

Method DownloadExecutableBinaryFromURL

actor/pluginaction/install.go:62–74  ·  view source on GitHub ↗

DownloadExecutableBinaryFromURL fetches a plugin binary from the specified URL, if it exists.

(pluginURL string, tempPluginDir string, proxyReader plugin.ProxyReader)

Source from the content-addressed store, hash-verified

60// DownloadExecutableBinaryFromURL fetches a plugin binary from the specified
61// URL, if it exists.
62func (actor Actor) DownloadExecutableBinaryFromURL(pluginURL string, tempPluginDir string, proxyReader plugin.ProxyReader) (string, error) {
63 tempFile, err := makeTempFile(tempPluginDir)
64 if err != nil {
65 return "", err
66 }
67
68 err = actor.client.DownloadPlugin(pluginURL, tempFile.Name(), proxyReader)
69 if err != nil {
70 return "", err
71 }
72
73 return tempFile.Name(), nil
74}
75
76// FileExists returns true if the file exists. It returns false if the file
77// doesn't exist or there is an error checking.

Callers

nothing calls this directly

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 3

makeTempFileFunction · 0.85
NameMethod · 0.80
DownloadPluginMethod · 0.65

Tested by

no test coverage detected