formula: configure git/npm to ignore .brew_home

This commit is contained in:
Branch Vincent 2024-04-19 11:45:06 -07:00
parent 47c2c6deed
commit 46a3bbe3c5
No known key found for this signature in database
2 changed files with 2 additions and 3 deletions

View File

@ -2673,6 +2673,8 @@ class Formula
def setup_home(home)
# Don't let bazel write to tmp directories we don't control or clean.
(home/".bazelrc").write "startup --output_user_root=#{home}/_bazel"
# Don't dirty the git tree for git clones.
(home/".gitignore").write "*"
end
# Returns a list of Dependency objects that are declared in the formula.

View File

@ -55,9 +55,6 @@ module Language
sig { params(libexec: Pathname).returns(T::Array[String]) }
def self.std_npm_install_args(libexec)
setup_npm_environment
# tell npm to not install .brew_home by adding it to the .npmignore file
# (or creating a new one if no .npmignore file already exists)
open(".npmignore", "a") { |f| f.write("\n.brew_home\n") }
pack = pack_for_installation