test: add integration test for 'gas init'
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -32,8 +33,9 @@ var cmd_init = &cobra.Command{
|
||||
// Get all the config values
|
||||
get_val := func(prompt string, val *string) {
|
||||
fmt.Printf("%s (%q): ", prompt, *val)
|
||||
input := ""
|
||||
Must(fmt.Scanln(&input))
|
||||
scanner := bufio.NewScanner(os.Stdin)
|
||||
scanner.Scan()
|
||||
input := scanner.Text()
|
||||
if input != "" {
|
||||
*val = input
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user