From 1424b20a3d59f7ba1defa5407e081a6dab55e9fa Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 4 Jul 2018 07:14:33 +0100 Subject: [PATCH] config: handle HOMEBREW_TEMP being unset. This can happen when updating from a previous version of Homebrew. --- Library/Homebrew/config.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/config.rb b/Library/Homebrew/config.rb index 64f83e0c15..69406d1601 100644 --- a/Library/Homebrew/config.rb +++ b/Library/Homebrew/config.rb @@ -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 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.realpath end