Return the installed path(s) from install

This commit is contained in:
Max Howell 2009-08-10 16:34:04 +01:00
parent 3cf869385e
commit 4355182529

View File

@ -32,18 +32,19 @@ class Pathname
def install src def install src
if src.is_a? Array if src.is_a? Array
src.each {|src| install src } src.collect {|src| install src }
elsif File.exist? src elsif File.exist? src
mkpath mkpath
if File.symlink? src if File.symlink? src
# we use the BSD mv command because FileUtils copies the target and # we use the BSD mv command because FileUtils copies the target and
# not the link! I'm beginning to wish I'd used Python quite honestly! # not the link! I'm beginning to wish I'd used Python quite honestly!
`mv #{src} #{to_s}` raise unless Kernel.system 'mv', src, to_s and $? == 0
else else
# we mv when possible as it is faster and you should only be using # we mv when possible as it is faster and you should only be using
# this function when installing from the temporary build directory # this function when installing from the temporary build directory
FileUtils.mv src, to_s FileUtils.mv src, to_s
end end
return self+src
end end
end end