Skip to content

Commit

Permalink
Exit with code 1 (error) if wizard failed. (#96)
Browse files Browse the repository at this point in the history
* Exit with code 1 (error) if wizard failed.
Should prevent error code 0 after
`creation failed: failed to create database (are you not running as root?).`
and similar errors.

* Switch error messages from stdin to stderr for init_wizard
  • Loading branch information
amarao authored Jun 2, 2021
1 parent 8017539 commit 0942452
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
match opt.command {
Command::New { opts } => {
if let Err(e) = initialize::init_wizard(&conf, opts) {
println!("{}: {}.", "creation failed".red(), e);
eprintln!("{}: {}.", "creation failed".red(), e);
std::process::exit(1);
}
},
Command::Uninstall { interface } => uninstall(&interface, &conf, opt.network)?,
Expand Down

0 comments on commit 0942452

Please sign in to comment.