提交 cb35a80e 编写于 作者: D Dmitriy Zaporozhets

Merge pull request #993 from veprbl/fix_archiving_prefix

Download button: put files into a directory
...@@ -115,10 +115,13 @@ module Repository ...@@ -115,10 +115,13 @@ module Repository
storage_path = File.join(Rails.root, "tmp", "repositories", self.code) storage_path = File.join(Rails.root, "tmp", "repositories", self.code)
file_path = File.join(storage_path, file_name) file_path = File.join(storage_path, file_name)
# Put files into a directory before archiving
prefix = self.code + "/"
# Create file if not exists # Create file if not exists
unless File.exists?(file_path) unless File.exists?(file_path)
FileUtils.mkdir_p storage_path FileUtils.mkdir_p storage_path
file = self.repo.archive_to_file(ref, nil, file_path) file = self.repo.archive_to_file(ref, prefix, file_path)
end end
file_path file_path
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册