From 7a6246a79cb5a6b609b8dc71ef34a2f392852f17 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Fri, 17 May 2024 01:31:32 +0100 Subject: [PATCH] extend/pathname: restore old rmtree behaviour --- Library/Homebrew/extend/pathname.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 8b0c072d4ccf29..55f7816700bab2 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -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