mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-07 03:55:23 +00:00
refactor(config): check for config file existence before processing subcommands (#214)
This commit is contained in:
parent
657af5e36d
commit
124c06c403
@ -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