|
|
|
@ -18,16 +18,22 @@ package installer // import "helm.sh/helm/v3/pkg/plugin/installer"
|
|
|
|
|
import (
|
|
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
|
|
"helm.sh/helm/v3/pkg/helmpath"
|
|
|
|
|
"helm.sh/helm/v3/pkg/cli"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type base struct {
|
|
|
|
|
// Source is the reference to a plugin
|
|
|
|
|
Source string
|
|
|
|
|
// PluginsDirectory is the directory where plugins are installed
|
|
|
|
|
PluginsDirectory string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func newBase(source string) base {
|
|
|
|
|
return base{source}
|
|
|
|
|
settings := cli.New()
|
|
|
|
|
return base{
|
|
|
|
|
Source: source,
|
|
|
|
|
PluginsDirectory: settings.PluginsDirectory,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Path is where the plugin will be installed.
|
|
|
|
@ -35,5 +41,5 @@ func (b *base) Path() string {
|
|
|
|
|
if b.Source == "" {
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
return helmpath.DataPath("plugins", filepath.Base(b.Source))
|
|
|
|
|
return filepath.Join(b.PluginsDirectory, filepath.Base(b.Source))
|
|
|
|
|
}
|
|
|
|
|