fix spacing

This commit is contained in:
2025-07-12 05:28:34 -07:00
parent 2cb2208478
commit 289584b24e

View File

@ -1,6 +1,7 @@
package main package main
import ( import (
"bufio"
"fmt" "fmt"
"github.com/BurntSushi/toml" "github.com/BurntSushi/toml"
"os" "os"
@ -40,12 +41,11 @@ func setupConfig(rerun bool) (*Config, error) {
_, statErr := os.Stat(cfgPath) _, statErr := os.Stat(cfgPath)
if rerun || os.IsNotExist(statErr) { if rerun || os.IsNotExist(statErr) {
fmt.Println("Enter the path to your Wow directory below. Use the full path without shortcuts like '~' (ex: /home/user/epoch):") fmt.Println("Enter the path to your Wow directory below. Use the full path without shortcuts like '~' (ex: /home/user/epoch):")
var s string s, err := readLine()
_, err = fmt.Scanln(&s)
if err != nil { if err != nil {
return nil, fmt.Errorf("unable to read input: %v", err) return nil, fmt.Errorf("unable to read input: %v", err)
} }
newConfig.WowDir = strings.TrimSpace(s) newConfig.WowDir = s
fmt.Println() fmt.Println()
p, err := promptYesNo(fmt.Sprintf("Do you want to use epochcli to launch Wow? Select No if you plan on using a launcher tool like Lutris (y/n): ")) p, err := promptYesNo(fmt.Sprintf("Do you want to use epochcli to launch Wow? Select No if you plan on using a launcher tool like Lutris (y/n): "))
@ -146,3 +146,12 @@ func input(prompt string) (string, error) {
} }
return strings.TrimSpace(s), nil return strings.TrimSpace(s), nil
} }
func readLine() (string, error) {
reader := bufio.NewReader(os.Stdin)
in, err := reader.ReadString('\n')
if err != nil {
return "", fmt.Errorf("unable to read input: %v", err)
}
return strings.TrimSpace(in), nil
}