utils: correctly handle empty user gem env.
This commit is contained in:
parent
f999a57620
commit
b369593cbd
@ -189,8 +189,11 @@ module Homebrew
|
|||||||
|
|
||||||
def install_gem_setup_path!(name, version = nil, executable = name)
|
def install_gem_setup_path!(name, version = nil, executable = name)
|
||||||
# Respect user's preferences for where gems should be installed.
|
# Respect user's preferences for where gems should be installed.
|
||||||
ENV["GEM_HOME"] = ENV["HOMEBREW_GEM_HOME"].to_s
|
ENV["GEM_HOME"] = if ENV["HOMEBREW_GEM_HOME"].to_s.empty?
|
||||||
ENV["GEM_HOME"] = Gem.user_dir if ENV["GEM_HOME"].empty?
|
Gem.user_dir
|
||||||
|
else
|
||||||
|
ENV["HOMEBREW_GEM_HOME"]
|
||||||
|
end
|
||||||
unless ENV["HOMEBREW_GEM_PATH"].to_s.empty?
|
unless ENV["HOMEBREW_GEM_PATH"].to_s.empty?
|
||||||
ENV["GEM_PATH"] = ENV["HOMEBREW_GEM_PATH"]
|
ENV["GEM_PATH"] = ENV["HOMEBREW_GEM_PATH"]
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user