Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-05-11 18:22:45 +0300
committerJames Lopez <james@jameslopez.es>2016-05-11 18:22:45 +0300
commita61456e44e8f26067187643a3f1b74b484428bad (patch)
tree029ba99959b31b1a6a861ff1ac7462b625d4f85f /lib/gitlab/import_export/importer.rb
parent27867f35429ad6d3ca232db159e7a98e400b1d41 (diff)
refactored import to use shared error stuff and fixed a few issues with recent refactorings
Diffstat (limited to 'lib/gitlab/import_export/importer.rb')
-rw-r--r--lib/gitlab/import_export/importer.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/gitlab/import_export/importer.rb b/lib/gitlab/import_export/importer.rb
index 8f838287f97..19c5aafad20 100644
--- a/lib/gitlab/import_export/importer.rb
+++ b/lib/gitlab/import_export/importer.rb
@@ -7,20 +7,23 @@ module Gitlab
new(*args).import
end
- def initialize(archive_file: , storage_path:)
+ def initialize(archive_file: , shared:)
@archive_file = archive_file
- @storage_path = storage_path
+ @shared = shared
end
def import
- FileUtils.mkdir_p(@storage_path)
+ FileUtils.mkdir_p(@shared.storage_path)
decompress_archive
+ rescue => e
+ @shared.error(e.message)
+ false
end
private
def decompress_archive
- untar_zxf(archive: @archive_file, dir: @storage_path)
+ untar_zxf(archive: @archive_file, dir: @shared.storage_path)
end
end
end