Skip to content
Snippets Groups Projects
Commit 2d34a35d authored by Hans Moog's avatar Hans Moog
Browse files

Fix: fix CLI plugin load order

parent 40ef9dda
No related branches found
No related tags found
No related merge requests found
package node package node
import ( import (
"fmt"
"strings" "strings"
"sync" "sync"
...@@ -22,14 +21,6 @@ func Load(plugins ...*Plugin) *Node { ...@@ -22,14 +21,6 @@ func Load(plugins ...*Plugin) *Node {
disabledPlugins[strings.ToLower(disabledPlugin)] = true disabledPlugins[strings.ToLower(disabledPlugin)] = true
} }
fmt.Println(" _____ _ _ ________ ______ ___ ___________ ")
fmt.Println(" / ___| | | |_ _| \\/ || \\/ || ___| ___ \\")
fmt.Println(" \\ `--.| |_| | | | | . . || . . || |__ | |_/ /")
fmt.Println(" `--. \\ _ | | | | |\\/| || |\\/| || __|| / ")
fmt.Println(" /\\__/ / | | |_| |_| | | || | | || |___| |\\ \\ ")
fmt.Println(" \\____/\\_| |_/\\___/\\_| |_/\\_| |_/\\____/\\_| \\_| fullnode 1.0")
fmt.Println()
node := &Node{ node := &Node{
logLevel: *LOG_LEVEL.Value, logLevel: *LOG_LEVEL.Value,
loggers: make([]*Logger, 0), loggers: make([]*Logger, 0),
...@@ -105,8 +96,6 @@ func (node *Node) LogFailure(pluginName string, message string) { ...@@ -105,8 +96,6 @@ func (node *Node) LogFailure(pluginName string, message string) {
} }
func (node *Node) Load(plugins ...*Plugin) { func (node *Node) Load(plugins ...*Plugin) {
node.LogInfo("Node", "Loading plugins ...")
if len(plugins) >= 1 { if len(plugins) >= 1 {
for _, plugin := range plugins { for _, plugin := range plugins {
if _, exists := disabledPlugins[strings.ToLower(strings.Replace(plugin.Name, " ", "", -1))]; !exists { if _, exists := disabledPlugins[strings.ToLower(strings.Replace(plugin.Name, " ", "", -1))]; !exists {
......
...@@ -2,6 +2,7 @@ package cli ...@@ -2,6 +2,7 @@ package cli
import ( import (
"flag" "flag"
"fmt"
"strings" "strings"
"github.com/iotaledger/goshimmer/packages/events" "github.com/iotaledger/goshimmer/packages/events"
...@@ -34,10 +35,22 @@ func init() { ...@@ -34,10 +35,22 @@ func init() {
parameter.Events.AddString.Attach(events.NewClosure(onAddStringParameter)) parameter.Events.AddString.Attach(events.NewClosure(onAddStringParameter))
flag.Usage = printUsage flag.Usage = printUsage
}
func configure(ctx *node.Plugin) {
flag.Parse() flag.Parse()
}
func configure(ctx *node.Plugin) {} fmt.Println(" _____ _ _ ________ ______ ___ ___________ ")
fmt.Println(" / ___| | | |_ _| \\/ || \\/ || ___| ___ \\")
fmt.Println(" \\ `--.| |_| | | | | . . || . . || |__ | |_/ /")
fmt.Println(" `--. \\ _ | | | | |\\/| || |\\/| || __|| / ")
fmt.Println(" /\\__/ / | | |_| |_| | | || | | || |___| |\\ \\ ")
fmt.Println(" \\____/\\_| |_/\\___/\\_| |_/\\_| |_/\\____/\\_| \\_| fullnode 1.0")
fmt.Println()
ctx.Node.LogInfo("Node", "Loading plugins ...")
}
var PLUGIN = node.NewPlugin("CLI", configure) var PLUGIN = node.NewPlugin("CLI", configure, func(plugin *node.Plugin) {
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment