Skip to content

Commit

Permalink
Merge pull request #17358 from samford/cask-audit-tmpdir-cleanup
Browse files Browse the repository at this point in the history
Clean up cask audit tmpdir after use
  • Loading branch information
MikeMcQuaid authored May 24, 2024
2 parents ea5023a + 5701f92 commit 86674b4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Library/Homebrew/cask/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ def initialize(
@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!
Expand Down

0 comments on commit 86674b4

Please sign in to comment.