Skip to content

Commit

Permalink
Merge pull request #179540 from Homebrew/rubocop-fix-rmrf-usage
Browse files Browse the repository at this point in the history
*casks: : Avoid using `FileUtils#rm_rf`, `FileUtils#rm_f` or `Pathname#rmtree`
  • Loading branch information
issyl0 committed Jul 14, 2024
2 parents 2998a15 + d07ee1d commit b3992ec
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Casks/a/android-ndk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
].each { |link_name| binary shimscript, target: link_name }

uninstall_postflight do
FileUtils.rm_f("#{HOMEBREW_PREFIX}/share/android-ndk")
FileUtils.rm("#{HOMEBREW_PREFIX}/share/android-ndk")
end

# No zap stanza required
Expand Down
2 changes: 1 addition & 1 deletion Casks/a/android-sdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
end

uninstall_postflight do
FileUtils.rm_f("#{HOMEBREW_PREFIX}/share/android-sdk")
FileUtils.rm("#{HOMEBREW_PREFIX}/share/android-sdk")
end

zap trash: "~/.android"
Expand Down
2 changes: 1 addition & 1 deletion Casks/f/flutter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
end

uninstall_postflight do
FileUtils.rm_f("#{HOMEBREW_PREFIX}/share/flutter")
FileUtils.rm("#{HOMEBREW_PREFIX}/share/flutter")
end

zap trash: "~/.flutter"
Expand Down
2 changes: 1 addition & 1 deletion Casks/m/minecraft-server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
end

uninstall_preflight do
FileUtils.rm_f eula_file
FileUtils.rm(eula_file)
end

zap trash: config_dir
Expand Down
2 changes: 1 addition & 1 deletion Casks/w/wezterm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
staged_subfolder = staged_path.glob(["WezTerm-*", "wezterm-*"]).first
if staged_subfolder
FileUtils.mv(staged_subfolder/"WezTerm.app", staged_path)
FileUtils.rm_rf(staged_subfolder)
FileUtils.rm_r(staged_subfolder)
end
end

Expand Down
2 changes: 1 addition & 1 deletion Casks/w/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
staged_subfolder = staged_path.glob(["WezTerm-*", "wezterm-*"]).first
if staged_subfolder
FileUtils.mv(staged_subfolder/"WezTerm.app", staged_path)
FileUtils.rm_rf(staged_subfolder)
FileUtils.rm_r(staged_subfolder)
end
end

Expand Down

0 comments on commit b3992ec

Please sign in to comment.