windows: fix shell detection to not bail on bash envs

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett 2015-05-05 12:19:53 -07:00
parent 10afd2da8a
commit c4dd9198c1
No known key found for this signature in database
GPG Key ID: A519480096146526
1 changed files with 2 additions and 2 deletions

View File

@ -611,8 +611,8 @@ func getCertPathInfo(c *cli.Context) libmachine.CertPathInfo {
func detectShell() (string, error) {
// attempt to get the SHELL env var
shell := filepath.Base(os.Getenv("SHELL"))
// none detected; check for windows env
if runtime.GOOS == "windows" {
// none detected; check for windows env and not bash (i.e. msysgit, etc)
if runtime.GOOS == "windows" && shell == "" {
log.Printf("On Windows, please specify either 'cmd' or 'powershell' with the --shell flag.\n\n")
return "", ErrUnknownShell
}