debian-mirror-gitlab/lib/gitlab/import_export/version_saver.rb
2019-02-15 15:39:39 +05:30

28 lines
548 B
Ruby

# 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