extlibs.rb: make symlink only if the target exists
This commit is contained in:
parent
3015a7aae7
commit
0b2fc4cf37
@ -99,6 +99,7 @@ class ExtLibs
|
|||||||
if (target = src).start_with?("/")
|
if (target = src).start_with?("/")
|
||||||
target = File.join([".."] * file.count("/"), src)
|
target = File.join([".."] * file.count("/"), src)
|
||||||
end
|
end
|
||||||
|
return unless File.exist?(File.expand_path(target, File.dirname(file)))
|
||||||
File.unlink(file) rescue nil
|
File.unlink(file) rescue nil
|
||||||
begin
|
begin
|
||||||
File.symlink(target, file)
|
File.symlink(target, file)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user