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
commit743b5e6feb05c92cfea49f89bc946ea1420b80fe (patch)
tree97b06b997d1e4e0c495f061918542f266461dce5 /Library/Homebrew/extend
parentdd9ef7b71b71193cc5284732fe26d62f9b25263c (diff)
downloadbrew-743b5e6feb05c92cfea49f89bc946ea1420b80fe.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 Homebrew/homebrew#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