mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-06 03:25:23 +00:00
feat(ux): automatically create default user configuration file if nonexistent (#196)
This commit is contained in:
parent
1899873680
commit
343ed3c126
@ -131,7 +131,9 @@ impl Config {
|
|||||||
debug!("Config: {:?}", cfg);
|
debug!("Config: {:?}", cfg);
|
||||||
Ok(cfg)
|
Ok(cfg)
|
||||||
} else {
|
} else {
|
||||||
warn!("No config file found at {:?}", config_dir);
|
warn!("No config file found at {:?}, creating default configuration file at that location.", config_dir);
|
||||||
|
// create the default configuration file in the user's config directory
|
||||||
|
std::fs::write(config_dir.join(CONFIG_FILE_NAME), CONFIG)?;
|
||||||
Ok(default_config)
|
Ok(default_config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user