Merge pull request #17965 from Homebrew/formula-cookbook-stop-recommending-rmrf

Formula-Cookbook: Stop recommending `rm_f` in `postinstall`
This commit is contained in:
Issy Long 2024-08-05 00:40:58 +01:00 committed by GitHub
commit 78132b13bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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. # Want to be able to display partial formulae in the docs.
Style/TopLevelMethodDefinition: Style/TopLevelMethodDefinition:
Enabled: false 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" url "https://example.com/foo-1.0.tar.gz"
def post_install 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" pkgetc.install_symlink Formula["ca-certificates"].pkgetc/"cert.pem"
end end
# ... # ...