Skip to content

Commit

Permalink
Merge pull request #178145 from Homebrew/two-rubocop-fileutils-rmrf
Browse files Browse the repository at this point in the history
b*: Fix `Homebrew/NoFileutilsRmrf` RuboCop offenses
  • Loading branch information
p-linnane committed Jul 25, 2024
2 parents 7234d17 + 97c8651 commit f508893
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Formula/b/balena-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ def install
arch = Hardware::CPU.intel? ? "x64" : Hardware::CPU.arch.to_s
node_modules = libexec/"lib/node_modules/balena-cli/node_modules"
node_modules.glob("{ffi-napi,ref-napi}/prebuilds/*")
.each { |dir| dir.rmtree if dir.basename.to_s != "#{os}-#{arch}" }
.each { |dir| rm_r(dir) if dir.basename.to_s != "#{os}-#{arch}" }

(node_modules/"lzma-native/build").rmtree
(node_modules/"usb").rmtree if OS.linux?
rm_r(node_modules/"lzma-native/build")
rm_r(node_modules/"usb") if OS.linux?

# Replace universal binaries with native slices
deuniversalize_machos
Expand Down
2 changes: 1 addition & 1 deletion Formula/b/bamtools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Bamtools < Formula

def install
# Delete bundled jsoncpp to avoid fallback
(buildpath/"src/third_party/jsoncpp").rmtree
rm_r(buildpath/"src/third_party/jsoncpp")

# Build shared library
system "cmake", "-S", ".", "-B", "build_shared",
Expand Down
6 changes: 3 additions & 3 deletions Formula/b/basex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class Basex < Formula

def install
rm Dir["bin/*.bat"]
rm_rf "repo"
rm_rf "data"
rm_rf "etc"
rm_r("repo")
rm_r("data")
rm_r("etc")

libexec.install Dir["*"]
bin.install Dir["#{libexec}/bin/*"]
Expand Down
2 changes: 1 addition & 1 deletion Formula/b/bee.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Bee < Formula
depends_on "openjdk"

def install
rm_rf Dir["bin/*.bat"]
rm_r(Dir["bin/*.bat"])
libexec.install Dir["*"]
(bin/"bee").write_env_script libexec/"bin/bee", Language::Java.java_home_env
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/b/benerator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Benerator < Formula

def install
# Remove unnecessary files
rm_f Dir["bin/*.bat", "bin/pom.xml"]
rm(Dir["bin/*.bat", "bin/pom.xml"])

# Installs only the "bin" and "lib" directories from the tarball
libexec.install Dir["bin", "lib"]
Expand Down
4 changes: 2 additions & 2 deletions Formula/b/bit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ def install
arch = Hardware::CPU.intel? ? "x64" : Hardware::CPU.arch.to_s
node_modules = libexec/"lib/node_modules/bit-bin/node_modules"
(node_modules/"leveldown/prebuilds/linux-x64/node.napi.musl.node").unlink
(node_modules/"leveldown/prebuilds").each_child { |dir| dir.rmtree if dir.basename.to_s != "#{os}-#{arch}" }
(node_modules/"leveldown/prebuilds").each_child { |dir| rm_r(dir) if dir.basename.to_s != "#{os}-#{arch}" }

# Remove vendored pre-built binary `terminal-notifier`
node_notifier_vendor_dir = node_modules/"node-notifier/vendor"
node_notifier_vendor_dir.rmtree # remove vendored pre-built binaries
rm_r(node_notifier_vendor_dir) # remove vendored pre-built binaries

if OS.mac?
terminal_notifier_dir = node_notifier_vendor_dir/"mac.noindex"
Expand Down
2 changes: 1 addition & 1 deletion Formula/b/bloaty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def install
# https://github.com/protocolbuffers/protobuf/issues/9947
ENV.append_to_cflags "-DNDEBUG"
# Remove vendored dependencies
%w[abseil-cpp capstone protobuf re2].each { |dir| (buildpath/"third_party"/dir).rmtree }
%w[abseil-cpp capstone protobuf re2].each { |dir| rm_r(buildpath/"third_party"/dir) }
abseil_cxx_standard = 17 # Keep in sync with C++ standard in abseil.rb
inreplace "CMakeLists.txt", "CMAKE_CXX_STANDARD 11", "CMAKE_CXX_STANDARD #{abseil_cxx_standard}"
inreplace "CMakeLists.txt", "-std=c++11", "-std=c++17"
Expand Down
2 changes: 1 addition & 1 deletion Formula/b/byteman.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Byteman < Formula
depends_on "openjdk"

def install
rm_rf Dir["bin/*.bat"]
rm_r(Dir["bin/*.bat"])
doc.install Dir["docs/*"], "README"
libexec.install ["bin", "lib", "contrib"]
pkgshare.install ["sample"]
Expand Down

0 comments on commit f508893

Please sign in to comment.