mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 21:16:30 +02:00
Respect -y
for packwiz init
(#290)
This commit is contained in:
parent
7545d9a777
commit
069d32c5de
@ -222,6 +222,10 @@ func init() {
|
|||||||
|
|
||||||
func initReadValue(prompt string, def string) string {
|
func initReadValue(prompt string, def string) string {
|
||||||
fmt.Print(prompt)
|
fmt.Print(prompt)
|
||||||
|
if viper.GetBool("non-interactive") {
|
||||||
|
fmt.Printf("%s\n", def)
|
||||||
|
return def
|
||||||
|
}
|
||||||
value, err := bufio.NewReader(os.Stdin).ReadString('\n')
|
value, err := bufio.NewReader(os.Stdin).ReadString('\n')
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Error reading input: %s\n", err)
|
fmt.Printf("Error reading input: %s\n", err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user