Rephrase the adivce, use the runtime.GOOS to check whether it is .exe binary and modify the error name to address comments in pull request.

pull/10354/head
hetong07 2021-02-03 18:01:30 -08:00
parent 289bf2fe84
commit 547f506701
2 changed files with 2 additions and 2 deletions

View File

@ -108,7 +108,7 @@ func Execute() {
}
}
if !found {
exit.Message(reason.WrongBinary, "Cannot run Windows binary inside WSL, please download linux binary from https://minikube.sigs.k8s.io/docs/start/. Or you can use '--force' to force execution which would be at your own risk.")
exit.Message(reason.WrongBinaryWSL, "You are trying to run windows .exe binary inside WSL, for better integration please use Linux binary instead (Download at https://minikube.sigs.k8s.io/docs/start/.). Otherwise if you still want to do this, you can do it using --force"
}
}
for _, c := range RootCmd.Commands() {

View File

@ -190,7 +190,7 @@ var (
RsrcInsufficientStorage = Kind{ID: "RSRC_INSUFFICIENT_STORAGE", ExitCode: ExInsufficientStorage, Style: style.UnmetRequirement}
WrongBinary = Kind{ID: "WRONG_BINARY", ExitCode: ExHostError}
WrongBinaryWSL = Kind{ID: "WRONG_BINARY_WSL", ExitCode: ExHostError}
HostHomeMkdir = Kind{ID: "HOST_HOME_MKDIR", ExitCode: ExHostPermission}
HostHomeChown = Kind{ID: "HOST_HOME_CHOWN", ExitCode: ExHostPermission}
HostBrowser = Kind{ID: "HOST_BROWSER", ExitCode: ExHostError}