Formula-Cookbook: Stop recommending rm_f in postinstall

- After all the work that went into
  https://github.com/Homebrew/brew/pull/17705, we
  don't want the docs disagreeing with what CI says
  the style should be.
This commit is contained in:
Issy Long 2024-08-04 23:57:49 +01:00
parent 9279693a34
commit 768ef34bc2
No known key found for this signature in database
2 changed files with 5 additions and 1 deletions

View File

@ -32,3 +32,7 @@ Style/RedundantRegexpArgument:
# Want to be able to display partial formulae in the docs.
Style/TopLevelMethodDefinition:
Enabled: false
# Formulae and Casks no longer use `rm_f`/`rm_rf`, so the docs need to match.
Lint/NonAtomicFileOperation:
Enabled: false

View File

@ -995,7 +995,7 @@ class Foo < Formula
url "https://example.com/foo-1.0.tar.gz"
def post_install
rm_f pkgetc/"cert.pem"
rm pkgetc/"cert.pem" if File.exist?(pkgetc/"cert.pem")
pkgetc.install_symlink Formula["ca-certificates"].pkgetc/"cert.pem"
end
# ...