From 2856a6c0ceeccb60e9ba1133837dddd40dbc4c1a Mon Sep 17 00:00:00 2001 From: stephenh-axiom-xyz Date: Sun, 15 Dec 2024 22:32:27 -0500 Subject: [PATCH] fix: output config TOML parse error when TOML exists but is incorrect (#1069) --- crates/cli/src/util.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/cli/src/util.rs b/crates/cli/src/util.rs index a80e9043e3..581f00acd9 100644 --- a/crates/cli/src/util.rs +++ b/crates/cli/src/util.rs @@ -83,13 +83,13 @@ pub(crate) fn read_to_stdin(input: &Option) -> Result { } pub(crate) fn read_config_toml_or_default(config: &PathBuf) -> Result> { - let mut app_config: Result> = read_to_struct_toml(config); - if app_config.is_err() { + if config.exists() { + read_to_struct_toml(config) + } else { println!( "{:?} not found, using default application configuration", config ); - app_config = Ok(default_app_config()); + Ok(default_app_config()) } - app_config }