mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-08 04:25:23 +00:00
refactor(config): check for config file existence before processing subcommands
This commit is contained in:
parent
971a2e7697
commit
6f6fc13aad
@ -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 =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user