Commit 4a4ed07a authored by Arnaud Bellec's avatar Arnaud Bellec

Do not flatten the zip files downloaded via http

parent 0be241d8
...@@ -74,12 +74,14 @@ module Pod ...@@ -74,12 +74,14 @@ module Pod
raise UnsupportedFileTypeError.new "Unsupported file type: #{type}" raise UnsupportedFileTypeError.new "Unsupported file type: #{type}"
end end
# If the archive only contained a folder, move its contents to the target (#727) # If the archive is a tarball and it only contained a folder, move its contents to the target (#727)
contents = target_path.children if [:tgz, :tar, :tbz].include? type
contents.delete(full_filename) contents = target_path.children
entry = contents.first contents.delete(full_filename)
if contents.count == 1 && entry.directory? entry = contents.first
FileUtils.move(entry.children, target_path) if contents.count == 1 && entry.directory?
FileUtils.move(entry.children, target_path)
end
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment