forked from toolshed/abra
refactor: moved all fatal errors to logrus
This will allow us to test commands that would normally exit
This commit is contained in:
@ -101,7 +101,7 @@ var appPsCommand = &cli.Command{
|
||||
cl := client.NewClientWithContext(Context)
|
||||
tasks, err := cl.TaskList(ctx, types.TaskListOptions{})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
for _, task := range tasks {
|
||||
resolver := idresolver.New(cl, false)
|
||||
@ -113,7 +113,7 @@ var appPsCommand = &cli.Command{
|
||||
}
|
||||
containers, err := cl.ContainerList(ctx, types.ContainerListOptions{})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
table := createTable([]string{"ID", "Image", "Command", "Created", "Status", "Ports", "Names"})
|
||||
var conTable [][]string
|
||||
@ -166,7 +166,7 @@ var appSecretCommand = &cli.Command{
|
||||
passgen.WordListDefault,
|
||||
)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
for _, password := range passwords {
|
||||
|
@ -2,9 +2,9 @@ package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
@ -46,6 +46,6 @@ func RunApp(version string, commit string) {
|
||||
|
||||
err := app.Run(os.Args)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user