diff options
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/tap.rb | 6 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/untap.rb | 8 |
2 files changed, 3 insertions, 11 deletions
diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index 13d9290e3..6d1a596a6 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -1,4 +1,3 @@ -require 'tempfile' HOMEBREW_LIBRARY = HOMEBREW_REPOSITORY/"Library" @@ -43,10 +42,7 @@ module Homebrew extend self end end - tf = Tempfile.new("brew-tap") - tf.write(ignores.uniq.join("\n")) - tf.close - mv tf.path, "#{HOMEBREW_LIBRARY}/Formula/.gitignore" + HOMEBREW_LIBRARY.join("Formula/.gitignore").atomic_write(ignores.uniq.join("\n")) end private diff --git a/Library/Homebrew/cmd/untap.rb b/Library/Homebrew/cmd/untap.rb index 80d38934b..92faf3069 100644 --- a/Library/Homebrew/cmd/untap.rb +++ b/Library/Homebrew/cmd/untap.rb @@ -1,5 +1,4 @@ -require 'cmd/tap' # for Pathname.recursive_formula -require 'tempfile' +require 'cmd/tap' # for tap_args module Homebrew extend self def untap @@ -18,9 +17,6 @@ module Homebrew extend self end rm_rf tapd - tf = Tempfile.new("brew-untap") - tf.write(gitignores.join("\n")) - tf.close - mv tf.path, "#{HOMEBREW_PREFIX}/Library/Formula/.gitignore" + HOMEBREW_REPOSITORY.join("Library/Formula/.gitignore").atomic_write(gitignores * "\n") end end |
