diff --git a/command/cleanup.go b/command/cleanup.go index f0aa202..2fbad44 100644 --- a/command/cleanup.go +++ b/command/cleanup.go @@ -36,6 +36,7 @@ func CmdCleanup(c *cli.Context) (err error) { } else { // undeploy all closed pull requests var deployed []string + deployed, err = listDeployedPullRequests(listScript) if err != nil { return err @@ -48,10 +49,13 @@ func CmdCleanup(c *cli.Context) (err error) { if err != nil { return err } + openPRs := make([]string, len(prs)) + for i, pr := range prs { openPRs[i] = fmt.Sprintf("pr-%d", *pr.Number) } + log.Println("open PRs:", openPRs) // Now get a list of all the deployed PRs that are not open @@ -72,7 +76,9 @@ func CmdCleanup(c *cli.Context) (err error) { pullRequestID, err := strconv.Atoi(name) if err != nil { log.Println("Unable to parse pull request id: ", name) + lastErr = err + continue } @@ -83,7 +89,9 @@ func CmdCleanup(c *cli.Context) (err error) { err = cmd.Run() if err != nil { log.Println("undeploy error: ", err) + lastErr = err + continue } diff --git a/command/cleanup_test.go b/command/cleanup_test.go deleted file mode 100644 index f924a59..0000000 --- a/command/cleanup_test.go +++ /dev/null @@ -1,7 +0,0 @@ -package command_test - -import "testing" - -func TestCmdCleanup(t *testing.T) { - // Write your code here -} diff --git a/command/please_test.go b/command/please_test.go index 03174e0..9a0c518 100644 --- a/command/please_test.go +++ b/command/please_test.go @@ -2,6 +2,6 @@ package command_test import "testing" -func TestCmdPlease(t *testing.T) { +func TestCmdPlease(_ *testing.T) { // Write your code here } diff --git a/gitsrc/gitsrc.go b/gitsrc/gitsrc.go index 2a24145..df4e498 100644 --- a/gitsrc/gitsrc.go +++ b/gitsrc/gitsrc.go @@ -69,34 +69,34 @@ func (x *gitSource) String(name string) (string, error) { // These are implemented to satisfy the altsrc.InputSourceContext interface -func (x *gitSource) Int(name string) (int, error) { +func (x *gitSource) Int(_ string) (int, error) { return 0, ErrNotSupported } -func (x *gitSource) Duration(name string) (time.Duration, error) { +func (x *gitSource) Float64(_ string) (float64, error) { return 0, ErrNotSupported } -func (x *gitSource) Float64(name string) (float64, error) { +func (x *gitSource) Duration(_ string) (time.Duration, error) { return 0, ErrNotSupported } -func (x *gitSource) StringSlice(name string) ([]string, error) { +func (x *gitSource) StringSlice(_ string) ([]string, error) { return nil, ErrNotSupported } -func (x *gitSource) IntSlice(name string) ([]int, error) { +func (x *gitSource) IntSlice(_ string) ([]int, error) { return nil, ErrNotSupported } -func (x *gitSource) Generic(name string) (cli.Generic, error) { //nolint:nolintlint,ireturn +func (x *gitSource) Generic(_ string) (cli.Generic, error) { //nolint:nolintlint,ireturn return nil, ErrNotSupported } -func (x *gitSource) Bool(name string) (bool, error) { +func (x *gitSource) Bool(_ string) (bool, error) { return false, ErrNotSupported } -func (x *gitSource) BoolT(name string) (bool, error) { +func (x *gitSource) BoolT(_ string) (bool, error) { return false, ErrNotSupported } diff --git a/main.go b/main.go index 64407fa..61abf5c 100644 --- a/main.go +++ b/main.go @@ -26,6 +26,5 @@ func main() { if err := app.Run(os.Args); err != nil { log.Fatal("ERROR:", err) - os.Exit(1) } }