2016-07-15 10:03:31 -04:00
|
|
|
module Gitlab
|
|
|
|
module ImportExport
|
|
|
|
class AvatarSaver
|
|
|
|
def initialize(project:, shared:)
|
|
|
|
@project = project
|
|
|
|
@shared = shared
|
|
|
|
end
|
|
|
|
|
|
|
|
def save
|
|
|
|
return true unless @project.avatar.exists?
|
|
|
|
|
2018-07-10 10:23:45 -04:00
|
|
|
Gitlab::ImportExport::UploadsManager.new(
|
|
|
|
project: @project,
|
|
|
|
shared: @shared,
|
2018-08-29 09:41:56 -04:00
|
|
|
relative_export_path: 'avatar'
|
2018-07-11 04:24:59 -04:00
|
|
|
).save
|
2016-07-15 10:03:31 -04:00
|
|
|
rescue => e
|
|
|
|
@shared.error(e)
|
|
|
|
false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|