Skip to content

Commit

Permalink
Fix bug for order dependent exit code.
Browse files Browse the repository at this point in the history
The following execution would log an error but return 0: `tex-fmt --check unformatted.tex formatted.tex` because the 0 overwrote the previously set exit code
  • Loading branch information
bnctth committed Jan 10, 2025
1 parent 5d4c476 commit ea3460b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ pub fn run(args: &Args, logs: &mut Vec<Log>) -> u8 {
for file in &args.files {
if let Some((file, text)) = read(file, logs) {
let new_text = format_file(&text, &file, args, logs);
exit_code = process_output(args, &file, &text, &new_text, logs);
exit_code |= process_output(args, &file, &text, &new_text, logs);
} else {
exit_code = 1;
}
Expand Down

0 comments on commit ea3460b

Please sign in to comment.