fix(pkg/plugin/installer): unix-style paths in HELM_PLUGINS for helm install

Supports unix-style paths (with a colon) in the HELM_PLUGINS env for installing new plugins.

Closes #11310

Signed-off-by: Sergei Karpov <xodmqjw@gmail.com>
pull/11675/head
Sergei Karpov 2 years ago
parent 99e9019e41
commit 681275cbb8

@ -29,12 +29,22 @@ type base struct {
} }
func newBase(source string) base { func newBase(source string) base {
settings := cli.New() pluginsDir := getPluginsDir()
pluginsDirs := filepath.SplitList(settings.PluginsDirectory)
return base{ return base{
Source: source, Source: source,
PluginsDirectory: pluginsDirs[0], PluginsDirectory: pluginsDir,
}
}
func getPluginsDir() string {
settings := cli.New()
if settings.PluginsDirectory == "" {
return ""
} }
pluginsDirs := filepath.SplitList(settings.PluginsDirectory)
return pluginsDirs[0]
} }
// Path is where the plugin will be installed. // Path is where the plugin will be installed.

Loading…
Cancel
Save