Merge pull request #4421 from MikeMcQuaid/set-homebrew-temp

config: handle HOMEBREW_TEMP being unset.
This commit is contained in:
ilovezfs 2018-07-04 07:34:18 +01:00 committed by GitHub
commit 319baa751f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,7 +40,9 @@ HOMEBREW_LOGS = Pathname.new(ENV["HOMEBREW_LOGS"] || "~/Library/Logs/Homebrew/")
# Must use /tmp instead of $TMPDIR because long paths break Unix domain sockets # Must use /tmp instead of $TMPDIR because long paths break Unix domain sockets
HOMEBREW_TEMP = begin HOMEBREW_TEMP = begin
tmp = Pathname.new(ENV["HOMEBREW_TEMP"]) # /tmp fallback is here for people auto-updating from a version where
# HOMEBREW_TEMP isn't set.
tmp = Pathname.new(ENV["HOMEBREW_TEMP"] || "/tmp")
tmp.mkpath unless tmp.exist? tmp.mkpath unless tmp.exist?
tmp.realpath tmp.realpath
end end