wip update
This commit is contained in:
18
config.go
18
config.go
@ -1,10 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/sqweek/dialog"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
@ -38,23 +36,13 @@ func setupConfig(rerun bool) (*Config, error) {
|
||||
|
||||
_, statErr := os.Stat(cfgPath)
|
||||
if rerun || os.IsNotExist(statErr) {
|
||||
fmt.Println("Press any key to open a file window and select your wow directory")
|
||||
var r rune
|
||||
_, _ = fmt.Scanf("%c", &r)
|
||||
|
||||
var err error
|
||||
newConfig.WowDir, err = dialog.Directory().Title("Select your wow directory").Browse()
|
||||
if err != nil {
|
||||
if errors.Is(err, dialog.ErrCancelled) {
|
||||
return nil, fmt.Errorf("cancelled dialog box, exiting")
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println("Enter the path to your Wow directory below:")
|
||||
fmt.Scanln(&newConfig.WowDir)
|
||||
|
||||
for {
|
||||
fmt.Printf("Do you want to use epochcli to launch Wow? Select No if you plan on using a launcher tool like Lutris (y/n): ")
|
||||
var s string
|
||||
_, err = fmt.Scanf("%s", &s)
|
||||
_, err := fmt.Scanf("%s", &s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user