diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 4e6ba7b56..5660a581f 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -20,7 +20,6 @@ package geth import ( "fmt" "os" - "path" "sort" "strconv" "strings" @@ -342,14 +341,7 @@ func prepare(ctx *cli.Context) { // blocking mode, waiting for it to be shut down. func geth(ctx *cli.Context) error { //begin PluGeth code injection - var pluginsDir string - if ctx.IsSet(utils.PluginsDirFlag.Name) { - pluginsDir = ctx.String(utils.PluginsDirFlag.Name) - } else { - pluginsDir = path.Join(ctx.String(utils.DataDirFlag.Name), "plugins") - } - - if err := plugins.Initialize(pluginsDir, ctx); err != nil { + if err := plugins.Initialize(ctx.String(utils.PluginsDirFlag.Name), ctx); err != nil { return err } prepare(ctx) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 62bef192d..a77739215 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -91,7 +91,8 @@ var ( //begin PluGeth code injection PluginsDirFlag = &flags.DirectoryFlag{ Name: "pluginsdir", - Usage: "Directory for plugins (default = datadir/plugins)", + Usage: "Directory for plugins", + Value: flags.DirectoryString(filepath.Join(node.DefaultDataDir(), "plugins")), Category: flags.EthCategory, } //end PluGeth code injection diff --git a/plugins/plugin_loader.go b/plugins/plugin_loader.go index 1e059d9bb..dfb4af030 100644 --- a/plugins/plugin_loader.go +++ b/plugins/plugin_loader.go @@ -58,7 +58,7 @@ func Lookup(name string, validate func(interface{}) bool) []interface{} { var DefaultPluginLoader *PluginLoader func NewPluginLoader(target string) (*PluginLoader, error) { - log.Info("Loading plugins from directory.", "path", target) + log.Info("Loading plugins from directory", "path", target) pl := &PluginLoader{ Plugins: []pluginDetails{}, Subcommands: make(map[string]Subcommand),