Skip to content

Commit

Permalink
Merge pull request #178713 from Homebrew/w-rubocop-no-rmrf
Browse files Browse the repository at this point in the history
w*: Fix `Homebrew/NoFileutilsRmrf` RuboCop offenses
  • Loading branch information
issyl0 committed Jul 28, 2024
2 parents 22a1f2f + 5f6699b commit d4e4a2d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Formula/w/walkmod.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Walkmod < Formula

def install
# Remove windows files
rm_f Dir["bin/*.bat"]
rm(Dir["bin/*.bat"])
libexec.install Dir["*"]
(bin/"walkmod").write_env_script libexec/"bin/walkmod", JAVA_HOME: Formula["openjdk"].opt_prefix
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/w/watchman.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def install
path = Pathname.new(File.join(prefix, HOMEBREW_PREFIX))
bin.install (path/"bin").children
lib.install (path/"lib").children
path.rmtree
rm_r(path)
end

def post_install
Expand Down
2 changes: 1 addition & 1 deletion Formula/w/web-ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def install

# Remove vendored pre-built binary `terminal-notifier`
node_notifier_vendor_dir = libexec/"lib/node_modules/web-ext/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/w/webtorrent-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def install
os = OS.kernel_name.downcase
arch = Hardware::CPU.intel? ? "x64" : Hardware::CPU.arch.to_s
libexec.glob("lib/node_modules/webtorrent-cli/node_modules/{bufferutil,utp-native,utf-8-validate}/prebuilds/*")
.each { |dir| dir.rmtree if dir.basename.to_s != "#{os}-#{arch}" }
.each { |dir| rm_r(dir) if dir.basename.to_s != "#{os}-#{arch}" }

# Replace universal binaries with their native slices
deuniversalize_machos
Expand Down
4 changes: 0 additions & 4 deletions Formula/w/whistle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ class Whistle < Formula
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]

# Remove x86 specific optional feature
node_modules = libexec/"lib/node_modules/whistle/node_modules"
rm_f node_modules/"set-global-proxy/lib/mac/whistle" if Hardware::CPU.arm?
end

test do
Expand Down
4 changes: 2 additions & 2 deletions Formula/w/wxwidgets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class Wxwidgets < Formula

def install
# Remove all bundled libraries excluding `nanosvg` which isn't available as formula
%w[catch pcre].each { |l| (buildpath/"3rdparty"/l).rmtree }
%w[expat jpeg png tiff zlib].each { |l| (buildpath/"src"/l).rmtree }
%w[catch pcre].each { |l| rm_r(buildpath/"3rdparty"/l) }
%w[expat jpeg png tiff zlib].each { |l| rm_r(buildpath/"src"/l) }

args = [
"--prefix=#{prefix}",
Expand Down

0 comments on commit d4e4a2d

Please sign in to comment.