mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Don't do expensive re-open of zip for each file add
This commit is contained in:
parent
f1f91763fb
commit
b0c5c95b5e
1 changed files with 3 additions and 5 deletions
|
@ -777,12 +777,10 @@ class Site < Sequel::Model
|
|||
|
||||
Zip::Archive.open(tmpfile.path, Zip::CREATE) do |ar|
|
||||
ar.add_dir(zip_name)
|
||||
end
|
||||
|
||||
Dir.glob("#{base_files_path}/**/*").each do |path|
|
||||
relative_path = path.gsub(base_files_path+'/', '')
|
||||
|
||||
Zip::Archive.open(tmpfile.path, Zip::CREATE) do |ar|
|
||||
Dir.glob("#{base_files_path}/**/*").each do |path|
|
||||
relative_path = path.gsub(base_files_path+'/', '')
|
||||
puts "adding #{relative_path}"
|
||||
if File.directory?(path)
|
||||
ar.add_dir(zip_name+'/'+relative_path)
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue