lib/eco-rake/lib/files/decrypt.rb in eco-rake-0.2.4 vs lib/eco-rake/lib/files/decrypt.rb in eco-rake-0.2.5
- old
+ new
@@ -10,16 +10,23 @@
attr_const :ignore_mdc_error, default: false
def task(*_args)
return display_target_files if options[:list]
return warn_missing_file if target_files.empty?
+
status = 0
target_files.each do |file|
delete_file(gpg_to_csv_filename(file))
- stat = sh_continue(decrypt_command(file, ignore_mdc_error: ignore_mdc_error))
+
+ stat = sh_continue(
+ decrypt_command(file, ignore_mdc_error: ignore_mdc_error)
+ )
+
status = stat unless stat.zero?
end
- delete_file(*target_files, message: "Deleting files from '#{source_folder}'") unless options[:simulate]
+
+ msg = "Deleting files from '#{source_folder}'"
+ delete_file(*target_files, message: msg) unless options[:simulate]
exit status unless status.zero?
end
def display_target_files
puts "Source gpg files ('#{source_folder}'):"