From 5c517a748caeff4c47b3603e628ca65c85e5361e Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Thu, 29 Jan 2026 12:54:45 -0700 Subject: [PATCH] fix: 'managarr config-path' should work without a pre-existing config already in place [#54] --- src/main.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2442e06..90b2666 100644 --- a/src/main.rs +++ b/src/main.rs @@ -127,6 +127,16 @@ async fn main() -> Result<()> { let running = Arc::new(AtomicBool::new(true)); let r = running.clone(); let args = Cli::parse(); + + if matches!(args.command, Some(Command::ConfigPath)) { + println!( + "{}", + confy::get_configuration_file_path("managarr", "config")?.display() + ); + + return Ok(()); + } + let mut config = if let Some(ref config_file) = args.global.config_file { load_config(config_file.to_str().expect("Invalid config file specified"))? } else { @@ -170,10 +180,7 @@ async fn main() -> Result<()> { generate(shell, &mut cli, "managarr", &mut io::stdout()) } Command::TailLogs { no_color } => tail_logs(no_color).await?, - Command::ConfigPath => println!( - "{}", - confy::get_configuration_file_path("managarr", "config")?.display() - ), + _ => {} }, None => { let app_nw = Arc::clone(&app);