Skip to content

Commit

Permalink
Fix non-bash login shell semantics.
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinChartier committed Jul 2, 2019
1 parent 2a34c7c commit f238e10
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions shell/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit f238e10

Please sign in to comment.