gitlab-org--gitlab-foss/lib/gitlab/import_export/version_saver.rb
2016-05-16 13:28:11 +02:00

31 lines
581 B
Ruby

module Gitlab
module ImportExport
class VersionSaver
def self.save(*args)
new(*args).save
end
def initialize(shared:)
@shared = shared
end
def save
FileUtils.mkdir_p(@shared.export_path)
File.open(version_file, 'w') do |file|
file.write(Gitlab::ImportExport.version)
end
rescue => e
@shared.error(e.message)
false
end
private
def version_file
File.join(@shared.export_path, Gitlab::ImportExport.version_filename)
end
end
end
end