From ee17131c37ff000e9e2f60d8e81500ff6b322a7b Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 29 May 2022 14:12:16 +0200 Subject: [PATCH] fix(deps): update module github.com/thegeeklab/drone-plugin-lib to v2 --- cmd/drone-github-comment/main.go | 18 +++++------------- go.mod | 2 +- go.sum | 4 ++-- plugin/plugin.go | 2 +- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/cmd/drone-github-comment/main.go b/cmd/drone-github-comment/main.go index edf4aa9..48dda3b 100644 --- a/cmd/drone-github-comment/main.go +++ b/cmd/drone-github-comment/main.go @@ -5,9 +5,9 @@ import ( "os" "github.com/joho/godotenv" + "github.com/sirupsen/logrus" "github.com/thegeeklab/drone-github-comment/plugin" - "github.com/thegeeklab/drone-plugin-lib/errors" - "github.com/thegeeklab/drone-plugin-lib/urfave" + "github.com/thegeeklab/drone-plugin-lib/v2/urfave" "github.com/urfave/cli/v2" ) @@ -36,7 +36,7 @@ func main() { } if err := app.Run(os.Args); err != nil { - errors.HandleExit(err) + logrus.Fatal(err) } } @@ -51,19 +51,11 @@ func run(settings *plugin.Settings) cli.ActionFunc { ) if err := plugin.Validate(); err != nil { - if e, ok := err.(errors.ExitCoder); ok { - return e - } - - return errors.ExitMessagef("validation failed: %w", err) + return fmt.Errorf("validation failed: %w", err) } if err := plugin.Execute(); err != nil { - if e, ok := err.(errors.ExitCoder); ok { - return e - } - - return errors.ExitMessagef("execution failed: %w", err) + return fmt.Errorf("execution failed: %w", err) } return nil diff --git a/go.mod b/go.mod index 3a5c6b4..5634f5f 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/google/go-github/v39 v39.2.0 github.com/joho/godotenv v1.4.0 github.com/sirupsen/logrus v1.8.1 - github.com/thegeeklab/drone-plugin-lib v1.0.0 + github.com/thegeeklab/drone-plugin-lib/v2 v2.0.0 github.com/urfave/cli/v2 v2.8.1 golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 ) diff --git a/go.sum b/go.sum index 562996a..c254566 100644 --- a/go.sum +++ b/go.sum @@ -130,8 +130,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/thegeeklab/drone-plugin-lib v1.0.0 h1:PQeLnJa0q988rODYod/XtDy/f0cHHUhOA2Y8m5XRW4g= -github.com/thegeeklab/drone-plugin-lib v1.0.0/go.mod h1:XAlZDTSNNJogOH1+nS5u0notdj5dO/gtKnU7guzE95g= +github.com/thegeeklab/drone-plugin-lib/v2 v2.0.0 h1:ejM1fIkGhn9sy7HTidRiQhZJuEfUNF6sO9ko090PYvM= +github.com/thegeeklab/drone-plugin-lib/v2 v2.0.0/go.mod h1:cXNc+dmGLA748rAnXVBsTFG1UO+A/0XlV5jUEf/ahgk= github.com/urfave/cli/v2 v2.8.1 h1:CGuYNZF9IKZY/rfBe3lJpccSoIY1ytfvmgQT90cNOl4= github.com/urfave/cli/v2 v2.8.1/go.mod h1:Z41J9TPoffeoqP0Iza0YbAhGvymRdZAd2uPmZ5JxRdY= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= diff --git a/plugin/plugin.go b/plugin/plugin.go index 4d16e7f..65eada6 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -1,7 +1,7 @@ package plugin import ( - "github.com/thegeeklab/drone-plugin-lib/drone" + "github.com/thegeeklab/drone-plugin-lib/v2/drone" ) // Plugin implements drone.Plugin to provide the plugin implementation.