diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-05-23 14:56:13 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-05-23 14:56:13 +0900 |
commit | 0b2fc4cf379dec82290c5bc9cc71ce8dc4e4f28b (patch) | |
tree | 38f018dca82e1b1e5b2d98231cdf33b3bde35843 | |
parent | 3015a7aae7ddc9b63149df34b1f12366e07a9563 (diff) | |
download | ruby-0b2fc4cf379dec82290c5bc9cc71ce8dc4e4f28b.tar.gz |
extlibs.rb: make symlink only if the target exists
-rwxr-xr-x | tool/extlibs.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tool/extlibs.rb b/tool/extlibs.rb index 33462ceb1d..720f1c767d 100755 --- a/tool/extlibs.rb +++ b/tool/extlibs.rb @@ -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) |