Skip to content

Commit

Permalink
bug(install): Fix 'Brew' pre-req installation.
Browse files Browse the repository at this point in the history
If 'brew' was not installed, then "jx install" attempts to install it, but fails because the command uses shell expansion,
but no shell. Fixed by changing the command to be 'sh', and have that run the brew installation command.
(I guess as pretty much everyone already has brew this doesn't get exercised too often!)
  • Loading branch information
markawm committed Nov 29, 2018
1 parent d0e7b1e commit ecb7513
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/jx/cmd/common_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ func (o *CommonOptions) installBrew() error {
if runtime.GOOS != "darwin" {
return nil
}
return o.RunCommand("/usr/bin/ruby", "-e", "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)")
log.Infof("Please enter your root password when prompted by the %s installation\n", util.ColorInfo("brew"))
//Make sure to run command through sh in order to get $() expanded.
return o.RunCommand("sh", "-c", "/usr/bin/ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"")
}

func shouldInstallBinary(name string) (fileName string, download bool, err error) {
Expand Down

0 comments on commit ecb7513

Please sign in to comment.