Skip to content

Commit

Permalink
feat: add logs to key command
Browse files Browse the repository at this point in the history
  • Loading branch information
mehditeymorian committed Aug 31, 2022
1 parent bb37175 commit 4df1584
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/cmd/key/key.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package key

import (
"log"
"os"

"github.com/AlecAivazis/survey/v2"
"github.com/mehditeymorian/jwt/internal/cmd"
"github.com/mehditeymorian/jwt/internal/config"
"github.com/pterm/pterm"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -52,7 +52,7 @@ func key(cmd *cobra.Command, args []string) {
ecdsa(cmd, args)

default:
log.Println("this type of key is not provided")
pterm.Warning.Println("this type of key is not provided")
}

}
Expand All @@ -62,11 +62,11 @@ func SaveKey(filename string, content []byte) {

file, err := os.Create(dir + filename)
if err != nil {
log.Fatalf("failed to save key in file: %v\n", err)
pterm.Fatal.Printf("failed to save key in file: %v\n", err)
}
defer file.Close()

file.Write(content)

log.Printf("key stored in %s/public.pem\n", dir)
pterm.Success.Printf("key stored in %s/public.pem\n", dir)
}

0 comments on commit 4df1584

Please sign in to comment.