Skip to content
Snippets Groups Projects
Commit 58cb4444 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

etc.install: handle recursive directory installs.

We need to install the helper module not just on `etc` but also on all
subdirectories of it too. Also, handle the case where we install
a subdirectory with etc.install.

Closes Homebrew/homebrew#26145.
parent 31dc3d1f
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,7 @@ class Pathname
dst = dst.to_s
dst = yield(src, dst) if block_given?
return unless dst
mkpath
......
......@@ -2,6 +2,12 @@ module InstallRenamed
def install_p src, new_basename = nil
super do |src, dst|
dst += "/#{File.basename(src)}" if File.directory? dst
if File.directory? src
Pathname.new(dst).install Dir["#{src}/*"]
next
end
append_default_if_different(src, dst)
end
end
......@@ -12,6 +18,14 @@ module InstallRenamed
end
end
def + path
super(path).extend(InstallRenamed)
end
def / path
super(path).extend(InstallRenamed)
end
private
def append_default_if_different src, dst
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment