updated uploads saver
This commit is contained in:
parent
816dfcb1c5
commit
7df495fb77
|
@ -14,15 +14,20 @@ module Gitlab
|
||||||
def save
|
def save
|
||||||
return true unless File.directory?(uploads_path)
|
return true unless File.directory?(uploads_path)
|
||||||
|
|
||||||
FileUtils.copy_entry(uploads_path, uploads_export_path)
|
copy_files(uploads_path, uploads_export_path)
|
||||||
true
|
|
||||||
rescue => e
|
rescue => e
|
||||||
@shared.error(e.message)
|
@shared.error(e)
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def copy_files(source, destination)
|
||||||
|
FileUtils.mkdir_p(destination)
|
||||||
|
FileUtils.copy_entry(source, destination)
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
def uploads_export_path
|
def uploads_export_path
|
||||||
File.join(@shared.export_path, 'uploads')
|
File.join(@shared.export_path, 'uploads')
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue