debian-mirror-gitlab/lib/gitlab/import_export/avatar_saver.rb
2021-06-08 01:23:25 +05:30

25 lines
520 B
Ruby

# frozen_string_literal: true
module Gitlab
module ImportExport
class AvatarSaver
def initialize(project:, shared:)
@project = project
@shared = shared
end
def save
return true unless @project.avatar.exists?
Gitlab::ImportExport::UploadsManager.new(
project: @project,
shared: @shared,
relative_export_path: 'avatar'
).save
rescue StandardError => e
@shared.error(e)
false
end
end
end
end