debian-mirror-gitlab/lib/gitlab/import_export/version_saver.rb

29 lines
548 B
Ruby
Raw Normal View History

2018-12-23 12:14:25 +05:30
# frozen_string_literal: true
2016-06-22 15:30:34 +05:30
module Gitlab
module ImportExport
class VersionSaver
2016-11-03 12:29:30 +05:30
include Gitlab::ImportExport::CommandLineUtil
2016-06-22 15:30:34 +05:30
def initialize(shared:)
@shared = shared
end
def save
2016-11-03 12:29:30 +05:30
mkdir_p(@shared.export_path)
2016-06-22 15:30:34 +05:30
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