* tool/mkrunnable.rb (Mswin#ln_safe): try mklink command if not
  linked already.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-02-24 04:59:03 +00:00
Родитель c8141a8158
Коммит 759724fa2d
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -19,6 +19,7 @@ module Mswin
def ln_safe(src, dest, *opt)
cmd = ["mklink", dest.tr("/", "\\"), src.tr("/", "\\")]
cmd[1, 0] = opt
return if system("cmd", "/c", *cmd)
# TODO: use RUNAS or something
puts cmd.join(" ")
end
@ -64,12 +65,14 @@ def relative_path_from(path, base)
end
def ln_relative(src, dest)
return if File.identical?(src, dest)
parent = File.dirname(dest)
File.directory?(parent) or mkdir_p(parent)
ln_safe(relative_path_from(src, parent), dest)
end
def ln_dir_relative(src, dest)
return if File.identical?(src, dest)
parent = File.dirname(dest)
File.directory?(parent) or mkdir_p(parent)
ln_dir_safe(relative_path_from(src, parent), dest)