Improve messaging of debug source location

This commit is contained in:
Lukas Oberhuber 2022-07-31 21:06:33 +01:00
parent 93132c6876
commit 41a5265466

View File

@ -29,6 +29,11 @@ class Mktemp
@retain @retain
end end
# True if the source files should be retained.
def retain_in_sources?
@retain_in_sources
end
# Instructs this Mktemp to not emit messages when retention is triggered. # Instructs this Mktemp to not emit messages when retention is triggered.
sig { void } sig { void }
def quiet! def quiet!
@ -73,7 +78,10 @@ class Mktemp
ignore_interrupts { chmod_rm_rf(tmpdir) } unless retain? ignore_interrupts { chmod_rm_rf(tmpdir) } unless retain?
end end
ensure ensure
ohai "Temporary files retained at:", @tmpdir.to_s if retain? && !@tmpdir.nil? && !@quiet if retain? && !@tmpdir.nil? && !@quiet
message = retain_in_sources? ? "Source files for debugging available at:" : "Temporary files retained at:"
ohai message, @tmpdir.to_s
end
end end
private private