Skip to content

Commit 0546d90

Browse files
authored
Merge pull request #1251 from MikeMcQuaid/diagnostic-no-write-tmp
diagnostic: handle HOMEBREW_TEMP mktmpdir failure.
2 parents 0c193c3 + 21ff82b commit 0546d90

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Library/Homebrew/diagnostic.rb

+10-5
Original file line numberDiff line numberDiff line change
@@ -644,13 +644,18 @@ def check_for_multiple_volumes
644644
real_cellar = HOMEBREW_CELLAR.realpath
645645
where_cellar = volumes.which real_cellar
646646

647-
tmp = Pathname.new(Dir.mktmpdir("doctor", HOMEBREW_TEMP))
648647
begin
649-
real_tmp = tmp.realpath.parent
650-
where_tmp = volumes.which real_tmp
651-
ensure
652-
Dir.delete tmp
648+
tmp = Pathname.new(Dir.mktmpdir("doctor", HOMEBREW_TEMP))
649+
begin
650+
real_tmp = tmp.realpath.parent
651+
where_tmp = volumes.which real_tmp
652+
ensure
653+
Dir.delete tmp
654+
end
655+
rescue
656+
return
653657
end
658+
654659
return if where_cellar == where_tmp
655660

656661
<<-EOS.undent

0 commit comments

Comments
 (0)