sbctl/sign: Added proper messages

Signed-off-by: Morten Linderud <morten@linderud.pw>
This commit is contained in:
Morten Linderud 2021-06-12 21:38:13 +02:00
parent 4de27722ee
commit 64cbd26bb3
No known key found for this signature in database
GPG Key ID: E742683BA08CB2FF
1 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package main
import (
"errors"
"os"
"path/filepath"
@ -37,8 +38,13 @@ var signCmd = &cobra.Command{
}
}
if err := sbctl.Sign(file, output, save); err != nil {
err = sbctl.Sign(file, output, save)
if errors.Is(err, sbctl.ErrAlreadySigned) {
logging.Print("File have already been signed %s\n", output)
} else if err != nil {
return err
} else {
logging.Ok("Signed %s", output)
}
return nil
},