Commit 87d2a763e61241ea8f1919c1b0f87d4a23efa5d6

Authored by Dmitry Kalinkin
1 parent 4c1f435a

fix archiving prefix

Showing 1 changed file with 4 additions and 1 deletions   Show diff stats
app/roles/repository.rb
@@ -133,10 +133,13 @@ module Repository @@ -133,10 +133,13 @@ module Repository
133 storage_path = File.join(Rails.root, "tmp", "repositories", self.code) 133 storage_path = File.join(Rails.root, "tmp", "repositories", self.code)
134 file_path = File.join(storage_path, file_name) 134 file_path = File.join(storage_path, file_name)
135 135
  136 + # Put files into a directory before archiving
  137 + prefix = self.code + "/"
  138 +
136 # Create file if not exists 139 # Create file if not exists
137 unless File.exists?(file_path) 140 unless File.exists?(file_path)
138 FileUtils.mkdir_p storage_path 141 FileUtils.mkdir_p storage_path
139 - file = self.repo.archive_to_file(ref, nil, file_path) 142 + file = self.repo.archive_to_file(ref, prefix, file_path)
140 end 143 end
141 144
142 file_path 145 file_path