test: add integration test for 'gas init'
All checks were successful
CI / build-docker (push) Successful in 7s
CI / build-docker-bootstrap (push) Has been skipped
CI / release-test (push) Successful in 20s

This commit is contained in:
2025-11-09 00:03:30 -08:00
parent a81dfb69a5
commit 2146e1de77
2 changed files with 35 additions and 2 deletions

View File

@@ -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
}