fall back to bash if can not detect

pull/7887/head
Medya Gh 2020-04-23 22:19:06 -07:00
parent 7c26023811
commit 191484e21a
No known key found for this signature in database
GPG Key ID: 7CF7792C6DF3245C
1 changed files with 10 additions and 1 deletions

View File

@ -27,6 +27,8 @@ import (
"strconv"
"strings"
lib_shell "github.com/docker/machine/libmachine/shell"
"github.com/golang/glog"
"github.com/spf13/cobra"
"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/minikube/command"
@ -168,7 +170,14 @@ var dockerEnvCmd = &cobra.Command{
if ec.Shell == "" {
ec.Shell, err = shell.Detect()
if err != nil {
exit.WithError("Error detecting shell", err)
// if we can't detect it could be bash. for example github actions
if err == lib_shell.ErrUnknownShell {
ec.Shell = "bash"
glog.Warningf("couldn't detect shell type, will default to bash: %v", err)
} else {
exit.WithError("Error detecting shell", err)
}
}
}