Skip to content

Commit

Permalink
extlibs.rb: make symlink only if the target exists
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed May 23, 2020
1 parent 3015a7a commit 0b2fc4c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tool/extlibs.rb
Expand Up @@ -99,6 +99,7 @@ def do_link(file, src, dest)
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)
Expand Down

0 comments on commit 0b2fc4c

Please sign in to comment.