[Bug #18623] Link only existing excutables to make runnable [ci skip]

This commit is contained in:
Nobuyoshi Nakada 2022-12-06 17:49:50 +09:00
parent 81e274c990
commit 901471ab8a
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

View File

@ -93,7 +93,9 @@ def ln_relative(src, dest, executable = false)
return if File.identical?(src, dest)
parent = File.dirname(dest)
File.directory?(parent) or mkdir_p(parent)
return ln_exe(src, dest) if executable
if executable
return (ln_exe(src, dest) if File.exist?(src))
end
clean_link(relative_path_from(src, parent), dest) {|s, d| ln_safe(s, d)}
end