Merge pull request #17483 from leoheitmannruiz/patch-1
This commit is contained in:
commit
dbe03743f8
@ -21,13 +21,13 @@ RSpec.describe Utils::Shell do
|
|||||||
|
|
||||||
it "returns /tmp/.zshrc for Zsh if ZDOTDIR is /tmp" do
|
it "returns /tmp/.zshrc for Zsh if ZDOTDIR is /tmp" do
|
||||||
ENV["SHELL"] = "/bin/zsh"
|
ENV["SHELL"] = "/bin/zsh"
|
||||||
ENV["ZDOTDIR"] = "/tmp"
|
ENV["HOMEBREW_ZDOTDIR"] = "/tmp"
|
||||||
expect(described_class.profile).to eq("/tmp/.zshrc")
|
expect(described_class.profile).to eq("/tmp/.zshrc")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns ~/.zshrc for Zsh" do
|
it "returns ~/.zshrc for Zsh" do
|
||||||
ENV["SHELL"] = "/bin/zsh"
|
ENV["SHELL"] = "/bin/zsh"
|
||||||
ENV["ZDOTDIR"] = nil
|
ENV["HOMEBREW_ZDOTDIR"] = nil
|
||||||
expect(described_class.profile).to eq("~/.zshrc")
|
expect(described_class.profile).to eq("~/.zshrc")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,7 @@ module Utils
|
|||||||
rc_profile = "#{Dir.home}/.rcrc"
|
rc_profile = "#{Dir.home}/.rcrc"
|
||||||
return rc_profile if File.exist? rc_profile
|
return rc_profile if File.exist? rc_profile
|
||||||
when :zsh
|
when :zsh
|
||||||
return "#{ENV["ZDOTDIR"]}/.zshrc" if ENV["ZDOTDIR"].present?
|
return "#{ENV["HOMEBREW_ZDOTDIR"]}/.zshrc" if ENV["HOMEBREW_ZDOTDIR"].present?
|
||||||
end
|
end
|
||||||
|
|
||||||
SHELL_PROFILE_MAP.fetch(preferred, "~/.profile")
|
SHELL_PROFILE_MAP.fetch(preferred, "~/.profile")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user