mirror of
https://github.com/mudler/luet.git
synced 2025-07-05 11:37:41 +00:00
Print plugin success messages + print plugin location on load (#267)
* report plugin state if succeed We havbe a state field in the plugin response that its not being used for anything. This patch makes luet print the state reported from the plugin if its not empty as a way for plugins to report data on success to users. If the field is empty it will be ignored. Signed-off-by: Itxaka <igarcia@suse.com> * Print plugin path This patch adds the plugin location to the printed plugin list for a more rich view of the loaded plugins Signed-off-by: Itxaka <igarcia@suse.com>
This commit is contained in:
parent
5e8a9c75dc
commit
1b35a674ea
@ -103,7 +103,7 @@ To build a package, from a tree definition:
|
|||||||
if len(bus.Manager.Plugins) != 0 {
|
if len(bus.Manager.Plugins) != 0 {
|
||||||
util.DefaultContext.Info(":lollipop:Enabled plugins:")
|
util.DefaultContext.Info(":lollipop:Enabled plugins:")
|
||||||
for _, p := range bus.Manager.Plugins {
|
for _, p := range bus.Manager.Plugins {
|
||||||
util.DefaultContext.Info("\t:arrow_right:", p.Name)
|
util.DefaultContext.Info(fmt.Sprintf("\t:arrow_right: %s (at %s)", p.Name, p.Executable))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -99,6 +99,12 @@ func (b *Bus) Initialize(ctx *types.Context, plugin ...string) {
|
|||||||
if r.Errored() {
|
if r.Errored() {
|
||||||
err := fmt.Sprintf("Plugin %s at %s had an error: %s", p.Name, p.Executable, r.Error)
|
err := fmt.Sprintf("Plugin %s at %s had an error: %s", p.Name, p.Executable, r.Error)
|
||||||
ctx.Fatal(err)
|
ctx.Fatal(err)
|
||||||
|
} else {
|
||||||
|
if r.State != "" {
|
||||||
|
message := fmt.Sprintf(":lollipop: Plugin %s at %s succeded, state reported:", p.Name, p.Executable)
|
||||||
|
ctx.Success(message)
|
||||||
|
ctx.Info(r.State)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user