NewHTTPInstaller creates a new HttpInstaller.
(source string)
| 46 | |
| 47 | // NewHTTPInstaller creates a new HttpInstaller. |
| 48 | func NewHTTPInstaller(source string) (*HTTPInstaller, error) { |
| 49 | key, err := cache.Key(source) |
| 50 | if err != nil { |
| 51 | return nil, err |
| 52 | } |
| 53 | |
| 54 | extractor, err := NewExtractor(source) |
| 55 | if err != nil { |
| 56 | return nil, err |
| 57 | } |
| 58 | |
| 59 | get, err := getter.All(new(cli.EnvSettings)).ByScheme("http") |
| 60 | if err != nil { |
| 61 | return nil, err |
| 62 | } |
| 63 | |
| 64 | i := &HTTPInstaller{ |
| 65 | CacheDir: helmpath.CachePath("plugins", key), |
| 66 | PluginName: stripPluginName(filepath.Base(source)), |
| 67 | base: newBase(source), |
| 68 | extractor: extractor, |
| 69 | getter: get, |
| 70 | } |
| 71 | return i, nil |
| 72 | } |
| 73 | |
| 74 | // Install downloads and extracts the tarball into the cache directory |
| 75 | // and installs into the plugin directory. |
no test coverage detected
searching dependent graphs…