From 09424529509cc6c363a18648f5d5842291bcb0f4 Mon Sep 17 00:00:00 2001 From: George Shuklin Date: Wed, 2 Jun 2021 08:14:54 +0300 Subject: [PATCH] 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 --- server/src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/main.rs b/server/src/main.rs index 456f3be..13fa7c6 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -236,7 +236,8 @@ async fn main() -> Result<(), Box> { 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)?,