This commit is contained in:
Roy Crihfield 2023-06-29 16:12:47 +08:00
parent 80e02c90e3
commit feb6ccc72b
3 changed files with 5 additions and 4 deletions

View File

@ -20,7 +20,7 @@ package geth
import (
"fmt"
"os"
"path"
"path/filepath"
"sort"
"strconv"
"strings"
@ -346,7 +346,7 @@ func geth(ctx *cli.Context) error {
if ctx.IsSet(utils.PluginsDirFlag.Name) {
pluginsDir = ctx.String(utils.PluginsDirFlag.Name)
} else {
pluginsDir = path.Join(ctx.String(utils.DataDirFlag.Name), "plugins")
pluginsDir = filepath.Join(ctx.String(utils.DataDirFlag.Name), "plugins")
}
if err := plugins.Initialize(pluginsDir, ctx); err != nil {

View File

@ -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("<datadir>", "plugins")),
Category: flags.EthCategory,
}
//end PluGeth code injection

View File

@ -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),