Skip to content

Commit

Permalink
fix:[close #16] stop calling plugin twice
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkobrombin authored Jan 6, 2024
2 parents 9fa9c23 + dd10cb3 commit 35802b7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
var openedPlugins map[string]Plugin

func LoadPlugin(name string, module interface{}, recipe *api.Recipe) (string, error) {
if openedPlugins == nil {
openedPlugins = make(map[string]Plugin)
}
if openedPlugins == nil {
openedPlugins = make(map[string]Plugin)
}
pluginOpened := false
var buildModule Plugin
buildModule, pluginOpened = openedPlugins[name]
Expand All @@ -33,6 +33,5 @@ func LoadPlugin(name string, module interface{}, recipe *api.Recipe) (string, er
openedPlugins[name] = buildModule
}
fmt.Printf("Using plugin: %s\n", buildModule.Name)
fmt.Println(buildModule.BuildFunc(module, recipe))
return buildModule.BuildFunc(module, recipe)
}

0 comments on commit 35802b7

Please sign in to comment.