Exit with code 1 (error) if wizard failed. (#96)

* 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
This commit is contained in:
George Shuklin 2021-06-02 08:14:54 +03:00 committed by GitHub
parent 8017539f82
commit 0942452950
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)?,