mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-28 22:16:15 +10:00
28 lines
541 B
Ruby
28 lines
541 B
Ruby
module Gitlab
|
|
module ImportExport
|
|
class Importer
|
|
include Gitlab::ImportExport::CommandLineUtil
|
|
|
|
def self.import(*args)
|
|
new(*args).import
|
|
end
|
|
|
|
def initialize(archive_file: , storage_path:)
|
|
@archive_file = archive_file
|
|
@storage_path = storage_path
|
|
end
|
|
|
|
def import
|
|
FileUtils.mkdir_p(@storage_path)
|
|
decompress_archive
|
|
end
|
|
|
|
private
|
|
|
|
def decompress_archive
|
|
untar_zxf(archive: @archive_file, dir: @storage_path)
|
|
end
|
|
end
|
|
end
|
|
end
|