commit - 72c999365c60eaa762a71a50f16e40b61896913e
commit + 53515ec93f87219808a6d2bcbe9416f30d235cb0
blob - 27cb8abdb78e490a75bf55262bf6e0d16c4e5698
blob + 59acc67ba1e0fccebc9615d7ecea0568b2345dd8
--- src/cli.rs
+++ src/cli.rs
}
impl Cli {
- /// Parse the clap `Cli` struct with the command line arguments, create the directory for the
- /// configuration files, and create the database if it does not exist yet.
+ /// Parse the clap `Cli` struct with the command line arguments and create the database if it does not exist yet.
pub fn build_app() -> anyhow::Result<Self> {
- use std::fs::{self, File};
+ use std::fs::File;
let args = Cli::parse();
- let c_dir = config_dir();
- // ensure project config directory exists
- if !c_dir.exists() {
- debug!(
- "Config directory at {:?} does not exist, creating it.",
- c_dir
- );
- fs::create_dir(c_dir)?;
- }
-
if File::open(&args.database_path).is_err() {
debug!(
"No database file exists, creating a new one: {:?}",