formula: create empty zshrc when zsh is shell

One minor consequence of our seizing of the HOME variable during builds for
sandboxing purposes is that if you're doing an interactive or git installation
zsh flags up that it hasn't found any config files and throws you into the
`zsh-newuser-install` area.

Not really a problem, just a nuisance.

Since the check is just for existence rather than content, we can work around
this by creating an empty config file when the `SHELL` environmental variable
includes zsh.
This commit is contained in:
Dominyk Tiller 2015-07-24 09:01:34 +01:00
parent b1fff32055
commit 4625fd335c

View File

@ -928,6 +928,7 @@ class Formula
@buildpath = Pathname.pwd
env_home = buildpath/".brew_home"
mkdir_p env_home
touch env_home/".zshrc" if ENV["SHELL"].include? "zsh"
old_home, ENV["HOME"] = ENV["HOME"], env_home