Skip to content

Instantly share code, notes, and snippets.

@leepa
Created February 18, 2010 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leepa/307846 to your computer and use it in GitHub Desktop.
Save leepa/307846 to your computer and use it in GitHub Desktop.
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 61a2a2d..228e1d5 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -29,7 +29,12 @@ class Pathname
if src.is_a? Array
src.collect {|src| install src }
else
- raise "#{src} does not exist" unless File.exist? src
+ # if it's a symlink, don't resolve it to a file because if we are moving
+ # files one by one, it's likely we will break the symlink by moving what
+ # it points to before we move it
+ # and also broken symlinks are not the end of the world
+ raise "#{src} does not exist" unless File.symlink? src or File.exist? src
+
mkpath
if File.symlink? src
# we use the BSD mv command because FileUtils copies the target and
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment