diff --git a/src/main.rs b/src/main.rs index 64ea594..908b400 100644 --- a/src/main.rs +++ b/src/main.rs @@ -133,9 +133,10 @@ fn process_config_item(options: &Options, config_item: &OSSBackupdConfigItem, let zip_file = || { if let Err(e) = zip_util::compress_file(target, temp_zip_file) { print_error(&format!("Error in zip file: {}, at item index: {}", e, item_index)); - return false; - }; - true + false + } else { + true + } }; #[cfg(feature = "use_zip")] let zip_file = || { @@ -143,9 +144,10 @@ fn process_config_item(options: &Options, config_item: &OSSBackupdConfigItem, cmd.args(&["-r", temp_zip_file, target]); if let Err(e) = rust_util::util_cmd::run_command_and_wait(&mut cmd) { print_message(MessageType::ERROR, &format!("Error in zip file: {}, at item index: {}", e, item_index)); - return false; + false + } else { + true } - true }; if !zip_file() { @@ -166,9 +168,10 @@ fn process_config_item(options: &Options, config_item: &OSSBackupdConfigItem, if let Err(e) = open_pgp_tool.encrypt_file(temp_zip_file, temp_pgp_file, false) { print_message(MessageType::ERROR, &format!("Error in encrypt file: {}, at item index: {}", e, item_index)); remove_temp_files(); - return false; - }; - true + false + } else { + true + } }; #[cfg(not(feature = "use_sequoia_openpgp"))] let enc_file_by_pgp = || { @@ -176,9 +179,10 @@ fn process_config_item(options: &Options, config_item: &OSSBackupdConfigItem, cmd.args(&["-e", "-r", encrypt_pubkey_file, "-o", temp_pgp_file, temp_zip_file]); if let Err(e) = rust_util::util_cmd::run_command_and_wait(&mut cmd) { print_error(&format!("Error in encrypt file: {}, at item index: {}", e, item_index)); - return false; + false + } else { + true } - true }; if !enc_file_by_pgp() {