Update symlink even if cached_location already exists.

This commit is contained in:
Markus Reiter 2018-08-25 22:03:16 +02:00
parent 9edc355052
commit b63ac557bc

View File

@ -297,9 +297,10 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
ignore_interrupts do ignore_interrupts do
temporary_path.rename(cached_location) temporary_path.rename(cached_location)
symlink_location.dirname.mkpath symlink_location.dirname.mkpath
end
end
FileUtils.ln_s cached_location.relative_path_from(symlink_location.dirname), symlink_location, force: true FileUtils.ln_s cached_location.relative_path_from(symlink_location.dirname), symlink_location, force: true
end
end
rescue CurlDownloadStrategyError rescue CurlDownloadStrategyError
raise if urls.empty? raise if urls.empty?
puts "Trying a mirror..." puts "Trying a mirror..."