aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
authorMisty De Meo2012-06-17 16:54:20 -0500
committerMisty De Meo2012-07-09 12:01:09 -0500
commitbf051054b621109aa4e064ec4045f4ce0e521066 (patch)
tree7cd273d7d89b9d75337b894dda3d93bddc266f04 /Library/Homebrew/extend
parent3c5f881e14ddaf2d0a6bb9651e1422ed4cb48185 (diff)
downloadhomebrew-bf051054b621109aa4e064ec4045f4ce0e521066.tar.bz2
link: add --force and --dry-run options
`brew link` can now be made to delete any conflicting files using the --force argument. It also has a --dry-run option, similar to git clean -n, which will list any files which would be deleted without touching the filesystem. Closes #11811. Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
Diffstat (limited to 'Library/Homebrew/extend')
-rw-r--r--Library/Homebrew/extend/pathname.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 600e114a6..946ea0d49 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -347,6 +347,11 @@ class Pathname
raise <<-EOS.undent
Could not symlink file: #{src.expand_path}
Target #{self} already exists. You may need to delete it.
+ To force the link and delete this file, do:
+ brew link -f formula_name
+
+ To list all files that would be deleted:
+ brew link -n formula_name
EOS
elsif !dirname.writable?
raise <<-EOS.undent