2016-05-16 10:04:31 +00:00
|
|
|
module Gitlab
|
|
|
|
module ImportExport
|
|
|
|
class VersionSaver
|
|
|
|
|
|
|
|
def initialize(shared:)
|
|
|
|
@shared = shared
|
|
|
|
end
|
|
|
|
|
|
|
|
def save
|
2016-05-16 11:28:11 +00:00
|
|
|
FileUtils.mkdir_p(@shared.export_path)
|
|
|
|
|
2016-06-13 16:24:21 +00:00
|
|
|
File.write(version_file, Gitlab::ImportExport.version, mode: 'w')
|
2016-05-16 10:04:31 +00:00
|
|
|
rescue => e
|
2016-05-16 10:39:42 +00:00
|
|
|
@shared.error(e)
|
2016-05-16 10:04:31 +00:00
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def version_file
|
|
|
|
File.join(@shared.export_path, Gitlab::ImportExport.version_filename)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|