From 7332e2e4c47ca1604f1bcad73b7a27ae4704b178 Mon Sep 17 00:00:00 2001 From: James Groom Date: Sun, 10 Mar 2024 22:02:29 +1000 Subject: [PATCH] Respect `-y` for `packwiz init` --- cmd/init.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/init.go b/cmd/init.go index 9516093..45edd5d 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -222,6 +222,10 @@ func init() { func initReadValue(prompt string, def string) string { fmt.Print(prompt) + if viper.GetBool("non-interactive") { + fmt.Printf("%s\n", def) + return def + } value, err := bufio.NewReader(os.Stdin).ReadString('\n') if err != nil { fmt.Printf("Error reading input: %s\n", err)