refactor(config): check for config file existence before processing subcommands

This commit is contained in:
Alexandre Pasmantier 2025-01-04 23:52:55 +01:00
parent 971a2e7697
commit 6f6fc13aad

View File

@ -45,6 +45,8 @@ async fn main() -> Result<()> {
let args: PostProcessedCli = Cli::parse().into();
debug!("{:?}", args);
let mut config = Config::new()?;
if let Some(command) = args.command {
match command {
cli::Command::ListChannels => {
@ -59,7 +61,6 @@ async fn main() -> Result<()> {
}
}
let mut config = Config::new()?;
config.config.tick_rate =
args.tick_rate.unwrap_or(config.config.tick_rate);
config.config.frame_rate =