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

version_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: 8230c0f1e774eae2d5d308825200f9a3a0c12e63 (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
26
27
28
# frozen_string_literal: true

module Gitlab
  module ImportExport
    class VersionSaver
      include Gitlab::ImportExport::CommandLineUtil

      def initialize(shared:)
        @shared = shared
      end

      def save
        mkdir_p(@shared.export_path)

        File.write(version_file, Gitlab::ImportExport.version, mode: 'w')
      rescue => e
        @shared.error(e)
        false
      end

      private

      def version_file
        File.join(@shared.export_path, Gitlab::ImportExport.version_filename)
      end
    end
  end
end