diff --git a/pkg/plugin/installer/base.go b/pkg/plugin/installer/base.go index e44d857d5..aa07c0d8a 100644 --- a/pkg/plugin/installer/base.go +++ b/pkg/plugin/installer/base.go @@ -29,12 +29,22 @@ type base struct { } func newBase(source string) base { - settings := cli.New() - pluginsDirs := filepath.SplitList(settings.PluginsDirectory) + pluginsDir := getPluginsDir() return base{ 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.