Merge pull request #17358 from samford/cask-audit-tmpdir-cleanup

Clean up cask audit tmpdir after use
This commit is contained in:
Mike McQuaid 2024-05-24 15:53:30 +01:00 committed by GitHub
commit 86674b4c23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,6 +47,12 @@ module Cask
@token_conflicts = token_conflicts
@only = only || []
@except = except || []
# Clean up `#extract_artifacts` tmp dir when Audit object is destroyed
ObjectSpace.define_finalizer(
self,
proc { FileUtils.remove_entry(@tmpdir) if @tmpdir },
)
end
def run!