mirror of https://github.com/ericonr/sbctl.git
list-*: Ensure we list all entries on error
Return some formatted string and return nil instead of aborting the entire listing when we encounter an error. Fixes: https://github.com/Foxboron/sbctl/issues/88 Signed-off-by: Morten Linderud <morten@linderud.pw>
This commit is contained in:
parent
947b6ba8e8
commit
9ff60964d5
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/foxboron/sbctl"
|
||||
|
@ -23,7 +24,8 @@ var listBundlesCmd = &cobra.Command{
|
|||
func(s *sbctl.Bundle) error {
|
||||
ok, err := sbctl.VerifyFile(sbctl.DBCert, s.Output)
|
||||
if err != nil {
|
||||
return err
|
||||
logging.Error(fmt.Errorf("%s: %w\n", s.Output, err))
|
||||
return nil
|
||||
}
|
||||
logging.Println("Enrolled bundles:\n")
|
||||
logging.Println(s.Output)
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/foxboron/sbctl"
|
||||
"github.com/foxboron/sbctl/logging"
|
||||
"github.com/spf13/cobra"
|
||||
|
@ -24,7 +26,8 @@ func RunList(_ *cobra.Command, args []string) error {
|
|||
func(s *sbctl.SigningEntry) error {
|
||||
ok, err := sbctl.VerifyFile(sbctl.DBCert, s.OutputFile)
|
||||
if err != nil {
|
||||
return err
|
||||
logging.Error(fmt.Errorf("%s: %w\n", s.OutputFile, err))
|
||||
return nil
|
||||
}
|
||||
logging.Println(s.File)
|
||||
logging.Print("Signed:\t\t")
|
||||
|
|
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/foxboron/sbctl"
|
||||
"github.com/foxboron/sbctl/logging"
|
||||
|
|
Loading…
Reference in New Issue