Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix symlink for removed file #32

Merged
merged 1 commit into from

2 participants

@gvalmon

Folder may have symlink to already removed file, in that case ::File.exist? will return false, but ::File.symlink will raise exception becase there are already exist symlink.

@rudionrails rudionrails merged commit 7f12672 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 30, 2014
  1. @gvalmon

    fix symlink for removed file

    gvalmon authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/yell/adapters/datefile.rb
View
2  lib/yell/adapters/datefile.rb
@@ -140,7 +140,7 @@ def symlink!
# do nothing, because symlink is already correct
return if ::File.symlink?(@original_filename) && ::File.readlink(@original_filename) == @filename
- ::File.unlink(@original_filename) if ::File.exist?(@original_filename)
+ ::File.unlink(@original_filename) if ::File.exist?(@original_filename) || ::File.symlink?(@original_filename)
::File.symlink(@filename, @original_filename)
end
Something went wrong with that request. Please try again.