BigW Consortium Gitlab

version_saver.rb 517 Bytes
Newer Older
1 2 3
module Gitlab
  module ImportExport
    class VersionSaver
4 5
      include Gitlab::ImportExport::CommandLineUtil

6 7 8 9 10
      def initialize(shared:)
        @shared = shared
      end

      def save
11
        mkdir_p(@shared.export_path)
James Lopez committed
12

James Lopez committed
13
        File.write(version_file, Gitlab::ImportExport.version, mode: 'w')
14
      rescue => e
15
        @shared.error(e)
16 17 18 19 20 21 22 23 24 25 26
        false
      end

      private

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