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

Fix: fixed disabled plugins

parent 2d34a35d
No related branches found
No related tags found
No related merge requests found
......@@ -14,13 +14,9 @@ type Node struct {
logLevel int
}
var disabledPlugins = make(map[string]bool)
var DisabledPlugins = make(map[string]bool)
func Load(plugins ...*Plugin) *Node {
for _, disabledPlugin := range strings.Fields(*DISABLE_PLUGINS.Value) {
disabledPlugins[strings.ToLower(disabledPlugin)] = true
}
node := &Node{
logLevel: *LOG_LEVEL.Value,
loggers: make([]*Logger, 0),
......@@ -98,7 +94,7 @@ func (node *Node) LogFailure(pluginName string, message string) {
func (node *Node) Load(plugins ...*Plugin) {
if len(plugins) >= 1 {
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 {
plugin.wg = node.wg
plugin.Node = node
......
......@@ -40,6 +40,10 @@ func init() {
func configure(ctx *node.Plugin) {
flag.Parse()
for _, disabledPlugin := range strings.Fields(*node.DISABLE_PLUGINS.Value) {
node.DisabledPlugins[strings.ToLower(disabledPlugin)] = true
}
fmt.Println(" _____ _ _ ________ ______ ___ ___________ ")
fmt.Println(" / ___| | | |_ _| \\/ || \\/ || ___| ___ \\")
fmt.Println(" \\ `--.| |_| | | | | . . || . . || |__ | |_/ /")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment