summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-24 04:59:03 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-24 04:59:03 +0000
commit759724fa2d6e91152b8ffb4ec81f70efd0cd49d3 (patch)
tree6c27c99583ba24a18122fa62e1a43a392c5fc4a7 /tool
parentc8141a8158c1690c048689358e637558f248c577 (diff)
mkrunnable.rb: try mklink
* 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
Diffstat (limited to 'tool')
-rwxr-xr-xtool/mkrunnable.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/tool/mkrunnable.rb b/tool/mkrunnable.rb
index 7d37418..60d0889 100755
--- a/tool/mkrunnable.rb
+++ b/tool/mkrunnable.rb
@@ -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)