Skip to content

Commit

Permalink
exit with correct status for cli-validate
Browse files Browse the repository at this point in the history
  • Loading branch information
lmcmicu committed Oct 7, 2024
1 parent 28b21db commit bf670d3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,6 @@ async fn main() -> Result<()> {
.to_rich_json()
.expect("Error converting updated row to rich JSON"))
);
// TODO: Exit with the appropriate exit status.
}
}
Commands::Validate {
Expand All @@ -895,7 +894,13 @@ async fn main() -> Result<()> {
.to_rich_json()
.expect("Error converting validated row to rich JSON"))
);
// TODO: Exit with the appropriate exit status.

// Set the exit status:
let exit_code = output_row.contents.iter().all(|(_, vcell)| vcell.valid);
std::process::exit(match exit_code {
true => 0,
false => 1,
});
}
}

Expand Down

0 comments on commit bf670d3

Please sign in to comment.