Skip to content
Snippets Groups Projects
Commit cb35a80e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge pull request #993 from veprbl/fix_archiving_prefix

Download button: put files into a directory
parents cb6fcb65 87d2a763
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -115,10 +115,13 @@ module Repository
storage_path = File.join(Rails.root, "tmp", "repositories", self.code)
file_path = File.join(storage_path, file_name)
 
# Put files into a directory before archiving
prefix = self.code + "/"
# Create file if not exists
unless File.exists?(file_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
 
file_path
Loading
Loading
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