Refactoring of the unpack function

parent a03e1f64
...@@ -125,9 +125,8 @@ module Backup ...@@ -125,9 +125,8 @@ module Backup
end end
end end
# rubocop: disable Cop/AvoidReturnFromBlocks
def unpack def unpack
cleanup_required = true
Dir.chdir(backup_path) do Dir.chdir(backup_path) do
if ENV['BACKUP'].present? if ENV['BACKUP'].present?
# User has indicated which backup to restore # User has indicated which backup to restore
...@@ -153,9 +152,8 @@ module Backup ...@@ -153,9 +152,8 @@ module Backup
progress.puts 'Please specify which one you want to restore:' progress.puts 'Please specify which one you want to restore:'
progress.puts 'rake gitlab:backup:restore BACKUP=timestamp_of_backup' progress.puts 'rake gitlab:backup:restore BACKUP=timestamp_of_backup'
exit 1 exit 1
else
tar_file = backup_file_list.first
end end
tar_file = backup_file_list.first
progress.print 'Unpacking backup ... ' progress.print 'Unpacking backup ... '
...@@ -168,6 +166,7 @@ module Backup ...@@ -168,6 +166,7 @@ module Backup
end end
true true
end end
# rubocop: enable Cop/AvoidReturnFromBlocks
def tar_version def tar_version
tar_version, _ = Gitlab::Popen.popen(%w(tar --version)) tar_version, _ = Gitlab::Popen.popen(%w(tar --version))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment