Comment repository add_downloads_link raise

This commit is contained in:
konstantin.grabar 2011-10-28 03:01:12 +04:00
parent 282e97cbba
commit 3b78277536
1 changed files with 4 additions and 2 deletions

View File

@ -114,12 +114,14 @@ class Repository < ActiveRecord::Base
end
def add_downloads_symlink
raise "Personal platform path #{ symlink_downloads_path } already exists!" if File.exists?(symlink_downloads_path) && File.directory?(symlink_downloads_path)
#raise "Personal platform path #{ symlink_downloads_path } already exists!" if File.exists?(symlink_downloads_path) && File.directory?(symlink_downloads_path)
return true if File.exists?(symlink_downloads_path) && File.directory?(symlink_downloads_path)
FileUtils.symlink platform.path, symlink_downloads_path
end
def remove_downloads_symlink
raise "Personal platform path #{ symlink_downloads_path } does not exists!" if !(File.exists?(symlink_downloads_path) && File.directory?(symlink_downloads_path))
#raise "Personal platform path #{ symlink_downloads_path } does not exists!" if !(File.exists?(symlink_downloads_path) && File.directory?(symlink_downloads_path))
return true if !(File.exists?(symlink_downloads_path) && File.directory?(symlink_downloads_path))
FileUtils.rm_rf symlink_downloads_path
end