refactor symlink

This commit is contained in:
muratayusuke
2013-06-03 18:17:38 +00:00
parent 97fe1686f5
commit a95c4b2446
2 changed files with 54 additions and 39 deletions

View File

@@ -93,6 +93,7 @@ class Homesick
def ln_s(source, destination, config = {})
source = Pathname.new(source)
destination = Pathname.new(destination)
FileUtils.mkdir_p destination.dirname
if destination.symlink?
if destination.readlink == source