mirror of
https://github.com/ivabus/pop
synced 2024-09-19 16:10:48 +03:00
fix: exit status 1 when missing environment variable
This commit is contained in:
parent
68ec042eb7
commit
65b34a366a
5
main.go
5
main.go
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
@ -85,7 +86,9 @@ var rootCmd = &cobra.Command{
|
|||
if deliveryMethod == None {
|
||||
fmt.Printf("\n %s %s %s\n\n", errorHeaderStyle.String(), inlineCodeStyle.Render(ResendAPIKey), "environment variable is required.")
|
||||
fmt.Printf(" %s %s\n\n", commentStyle.Render("You can grab one at"), linkStyle.Render("https://resend.com/api-keys"))
|
||||
return nil
|
||||
cmd.SilenceUsage = true
|
||||
cmd.SilenceErrors = true
|
||||
return errors.New("missing required environment variable")
|
||||
}
|
||||
|
||||
if hasStdin() {
|
||||
|
|
Loading…
Reference in a new issue