mirror of
https://codeberg.org/woodpecker-plugins/go-plugin
synced 2026-06-04 18:23:54 +08:00
Bump urfave/cli to v3.2.0 (#49)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/49 Reviewed-by: Patrick Schratz <pat-s@noreply.codeberg.org> Co-authored-by: Robert Kaussow <mail@thegeeklab.de> Co-committed-by: Robert Kaussow <mail@thegeeklab.de>
This commit is contained in:
committed by
Patrick Schratz
parent
044f72ed49
commit
e3f4284781
@@ -42,7 +42,7 @@ type Options struct {
|
||||
|
||||
// Plugin defines the plugin instance.
|
||||
type Plugin struct {
|
||||
app *cli.Command
|
||||
App *cli.Command
|
||||
execute ExecuteFunc
|
||||
client *http.Client
|
||||
ctx context.Context
|
||||
@@ -68,11 +68,11 @@ func New(opt Options) *Plugin {
|
||||
}
|
||||
|
||||
plugin := &Plugin{
|
||||
app: app,
|
||||
App: app,
|
||||
execute: opt.Execute,
|
||||
ctx: opt.Context,
|
||||
}
|
||||
plugin.app.Action = plugin.action
|
||||
plugin.App.Action = plugin.action
|
||||
|
||||
if plugin.ctx == nil {
|
||||
plugin.ctx = context.Background()
|
||||
@@ -103,7 +103,7 @@ func (p *Plugin) HTTPClient() *http.Client {
|
||||
|
||||
// Run the plugin.
|
||||
func (p *Plugin) Run() {
|
||||
if err := p.app.Run(p.ctx, os.Args); err != nil {
|
||||
if err := p.App.Run(p.ctx, os.Args); err != nil {
|
||||
log.Error().Err(err).Msg("execution failed")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user