aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2015-07-28 14:50:58 +0800
committerXu Cheng2015-07-29 16:23:10 +0800
commit70025458f36c12768c603a3c9cc0f0faf32ccd98 (patch)
tree581c79cada83276e3f1e9bf1d23e6b265f4581a8
parent274f21388e3db056069fc176b24e543d666854c6 (diff)
downloadbrew-70025458f36c12768c603a3c9cc0f0faf32ccd98.tar.bz2
interactive_shell: create .zshrc when necessary
Closes Homebrew/homebrew#42190. Signed-off-by: Xu Cheng <xucheng@me.com>
-rw-r--r--Library/Homebrew/utils.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 9c0737ff5..1c3127f49 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -88,6 +88,10 @@ def interactive_shell f=nil
ENV['HOMEBREW_DEBUG_INSTALL'] = f.full_name
end
+ if ENV["SHELL"].include?("zsh") && ENV["HOME"].start_with?(HOMEBREW_TEMP.resolved_path.to_s)
+ FileUtils.touch "#{ENV["HOME"]}/.zshrc"
+ end
+
Process.wait fork { exec ENV['SHELL'] }
if $?.success?