Skip to content

Commit

Permalink
fix: prompt for input only once
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh committed Nov 14, 2023
1 parent 16cde2b commit 909bc19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func GetenvBool(key string) bool {

func GetenvPrompt(key string, prompt ...string) string {
value := Getenv(key, "")
for value == "" {
if value == "" {
if len(prompt) > 0 {
fmt.Printf("%s is not set. %s: ", key, prompt[0])
} else {
Expand All @@ -34,7 +34,7 @@ func GetenvPrompt(key string, prompt ...string) string {

func GetenvPromptSecret(key string, prompt ...string) string {
value := Getenv(key, "")
for value == "" {
if value == "" {
if len(prompt) > 0 {
fmt.Printf("%s is not set. %s: ", key, prompt[0])
} else {
Expand Down

0 comments on commit 909bc19

Please sign in to comment.