|
@@ -6,6 +6,7 @@ import (
|
|
"io/ioutil"
|
|
"io/ioutil"
|
|
"os"
|
|
"os"
|
|
"path/filepath"
|
|
"path/filepath"
|
|
|
|
+ "runtime"
|
|
"strings"
|
|
"strings"
|
|
)
|
|
)
|
|
|
|
|
|
@@ -71,6 +72,11 @@ func PromptForConfirmation(ins *InStream, outs *OutStream, message string) bool
|
|
|
|
|
|
fmt.Fprintf(outs, message)
|
|
fmt.Fprintf(outs, message)
|
|
|
|
|
|
|
|
+ // On Windows, force the use of the regular OS stdin stream.
|
|
|
|
+ if runtime.GOOS == "windows" {
|
|
|
|
+ ins = NewInStream(os.Stdin)
|
|
|
|
+ }
|
|
|
|
+
|
|
answer := ""
|
|
answer := ""
|
|
n, _ := fmt.Fscan(ins, &answer)
|
|
n, _ := fmt.Fscan(ins, &answer)
|
|
if n != 1 || (answer != "y" && answer != "Y") {
|
|
if n != 1 || (answer != "y" && answer != "Y") {
|