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

This commit is contained in:
Alex Pasmantier 2025-01-05 00:05:19 +01:00 committed by GitHub
parent 657af5e36d
commit 124c06c403
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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