diff --git a/Library/Homebrew/utils/shell.rb b/Library/Homebrew/utils/shell.rb index 9bd8b35399..8066702bf5 100644 --- a/Library/Homebrew/utils/shell.rb +++ b/Library/Homebrew/utils/shell.rb @@ -39,7 +39,8 @@ module Utils # return the shell profile file based on user's preferred shell def profile - return ENV.fetch("ZDOTDIR", "~") + "/.zshrc" if preferred.eql? "zsh" + return "#{ENV["ZDOTDIR"]}/.zshrc" if preferred == "zsh" && ENV["ZDOTDIR"].present? + SHELL_PROFILE_MAP.fetch(preferred, "~/.bash_profile") end