|
|
@ -19,6 +19,7 @@ import (
|
|
|
|
"errors"
|
|
|
|
"errors"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"path"
|
|
|
|
"path/filepath"
|
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
|
|
|
|
"k8s.io/helm/pkg/helm/helmpath"
|
|
|
|
"k8s.io/helm/pkg/helm/helmpath"
|
|
|
@ -42,6 +43,10 @@ type Installer interface {
|
|
|
|
|
|
|
|
|
|
|
|
// Install installs a plugin to $HELM_HOME.
|
|
|
|
// Install installs a plugin to $HELM_HOME.
|
|
|
|
func Install(i Installer) error {
|
|
|
|
func Install(i Installer) error {
|
|
|
|
|
|
|
|
if _, pathErr := os.Stat(path.Dir(i.Path())); os.IsNotExist(pathErr) {
|
|
|
|
|
|
|
|
return errors.New(`plugin home "$HELM_HOME/plugins" does not exists`)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if _, pathErr := os.Stat(i.Path()); !os.IsNotExist(pathErr) {
|
|
|
|
if _, pathErr := os.Stat(i.Path()); !os.IsNotExist(pathErr) {
|
|
|
|
return errors.New("plugin already exists")
|
|
|
|
return errors.New("plugin already exists")
|
|
|
|
}
|
|
|
|
}
|
|
|
|