From f238e10e704a8f7639669f15e59e899912baa82c Mon Sep 17 00:00:00 2001 From: Colin Chartier Date: Tue, 2 Jul 2019 16:38:51 -0400 Subject: [PATCH] Fix non-bash login shell semantics. --- shell/shell.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/shell/shell.go b/shell/shell.go index cff8d25..c580e3c 100644 --- a/shell/shell.go +++ b/shell/shell.go @@ -3,7 +3,6 @@ package shell import ( "github.com/pkg/errors" "os" - "path/filepath" ) //Shell represents, broadly, the current shell environment we're in (by having executed sanic env) @@ -48,10 +47,9 @@ func Current() (Shell, error) { //New creates a new sanic shell environment to execute commands in or to enter. func New(sanicRoot, sanicConfig, sanicEnvironment string) (Shell, error) { - shellPath := os.Getenv("SHELL") - shellName := filepath.Base(shellPath) - if shellName != "bash" { - return nil, errors.New("only bash is supported") + shellPath := os.Getenv("BASH") + if shellPath == "" { + return nil, errors.New("only bash is supported. Try typing 'bash' into your terminal") } return &BashShell{ Path: shellPath,