mirror of
https://github.com/ivabus/pop
synced 2024-11-10 02:25:19 +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
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
@ -85,7 +86,9 @@ var rootCmd = &cobra.Command{
|
||||||
if deliveryMethod == None {
|
if deliveryMethod == None {
|
||||||
fmt.Printf("\n %s %s %s\n\n", errorHeaderStyle.String(), inlineCodeStyle.Render(ResendAPIKey), "environment variable is required.")
|
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"))
|
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() {
|
if hasStdin() {
|
||||||
|
|
Loading…
Reference in a new issue