mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
extlibs.rb: make symlink only if the target exists
This commit is contained in:
parent
3015a7aae7
commit
0b2fc4cf37
1 changed files with 1 additions and 0 deletions
|
@ -99,6 +99,7 @@ class ExtLibs
|
|||
if (target = src).start_with?("/")
|
||||
target = File.join([".."] * file.count("/"), src)
|
||||
end
|
||||
return unless File.exist?(File.expand_path(target, File.dirname(file)))
|
||||
File.unlink(file) rescue nil
|
||||
begin
|
||||
File.symlink(target, file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue