From f88b464bf3bfa13dea33489d8f57e5380dbc00cd Mon Sep 17 00:00:00 2001 From: Jason Colyer Date: Tue, 15 Jan 2019 11:51:41 -0600 Subject: Modify file restore to rectify tar issue Adjusted run_pipeline! function to match rubocop syntax requirements Adjusted run_pipeline! function to use variable instead of string interpolation --- lib/backup/files.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/backup/files.rb') diff --git a/lib/backup/files.rb b/lib/backup/files.rb index 48cb01b5b82..550c932b2b5 100644 --- a/lib/backup/files.rb +++ b/lib/backup/files.rb @@ -75,12 +75,10 @@ module Backup options[:err] = err_w status = Open3.pieline(*cmd_list, options) err_w.close - unless status.compact.all?(&:success?) - error = err_r.read - unless error =~ /^g?tar: \.: Cannot mkdir: No such file or directory$/ - raise Backup::Error, 'Backup failed' - end - end + return if status.compact.all?(&:success?) + + regex = /^g?tar: \.: Cannot mkdir: No such file or directory$/ + raise Backup::Error, 'Backup failed' unless err_r.read =~ regex end end end -- cgit v1.2.1