Skip to content

Commit

Permalink
extend/pathname: restore old rmtree behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed May 17, 2024
1 parent 7452350 commit 7a6246a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Library/Homebrew/extend/pathname.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,13 @@ def stem
File.basename(self, extname)
end

# Like regular `rmtree`, except it never ignores errors.
sig { void }
def rmtree(**options)
FileUtils.rm_r(@path, **options)
nil
end

# I don't trust the children.length == 0 check particularly, not to mention
# it is slow to enumerate the whole directory just to see if it is empty,
# instead rely on good ol' libc and the filesystem
Expand Down

0 comments on commit 7a6246a

Please sign in to comment.