Skip to content

Commit

Permalink
removed error file delete logic
Browse files Browse the repository at this point in the history
  • Loading branch information
hitenkoku committed Dec 20, 2021
1 parent b09dec2 commit dcef677
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/detections/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,21 +240,9 @@ impl AlertMessage {

/// エラーログへのERRORメッセージの出力数を確認して、0であったらファイルを削除する。1以上あればエラーを書き出した旨を標準出力に表示する
pub fn output_error_log_exist() {
let error_log_path_str = ERROR_LOG_PATH.to_string();
// 1行しかなかった場合は最初に書いたコマンド情報のみと判断して削除する
if count_lines(File::open(&error_log_path_str).unwrap()).unwrap() == 1 {
if remove_file(&error_log_path_str).is_err() {
AlertMessage::alert(
&mut std::io::stderr().lock(),
format!("failed to remove file. filepath:{}", &error_log_path_str),
)
.ok();
}
return;
}
println!(
"Generated error was output to {}. Please see the file for details.",
&error_log_path_str
ERROR_LOG_PATH.to_string()
);
}
}
Expand Down

0 comments on commit dcef677

Please sign in to comment.