5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-08 06:50:56 +08:00

Merge pull request #177 from wailsapp/gitbash-fixes

fix: gitbash fixes
This commit is contained in:
Lea Anthony 2019-07-31 06:55:40 +10:00 committed by GitHub
commit d038dca37c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,6 @@ import (
"bufio"
"fmt"
"os"
"runtime"
"strconv"
"strings"
)
@ -20,11 +19,7 @@ func Prompt(question string, defaultValue ...string) string {
fmt.Printf(question + ": ")
reader := bufio.NewReader(os.Stdin)
input, _ := reader.ReadString('\n')
EOL := "\n"
if runtime.GOOS == "windows" {
EOL = "\r\n"
}
input = strings.Replace(input, EOL, "", -1)
input = strings.TrimSpace(input)
if input != "" {
answer = input