From 46a3bbe3c55b96cec041f620bb58442a47b3339e Mon Sep 17 00:00:00 2001 From: Branch Vincent Date: Fri, 19 Apr 2024 11:45:06 -0700 Subject: [PATCH] formula: configure git/npm to ignore .brew_home --- Library/Homebrew/formula.rb | 2 ++ Library/Homebrew/language/node.rb | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 55d114beeca62..5f83c4c7e10e7 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -2673,6 +2673,8 @@ def inreplace(paths, before = nil, after = nil, audit_result = true, &block) # r 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. diff --git a/Library/Homebrew/language/node.rb b/Library/Homebrew/language/node.rb index 8c4df5a233cb7..840df0d36e5af 100644 --- a/Library/Homebrew/language/node.rb +++ b/Library/Homebrew/language/node.rb @@ -55,9 +55,6 @@ def self.setup_npm_environment 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