Welcome to mirror list, hosted at ThFree Co, Russian Federation.

avatar_saver.rb « import_export « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7534ab5a9ce267443c81eef9e8739d6119eb0a26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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