Fix database-path not being read from config
`database-path` in config was correct, but was being overwritten by `--database-path` option. In a test case the option was not given, but clap/structopt marked it as `present`. The occurrences were `0` though.
This commit is contained in:
parent
aa021a9754
commit
450ec49bf0
@ -28,12 +28,11 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
|
|
||||||
let mut config = Config::get(&options).await?;
|
let mut config = Config::get(&options).await?;
|
||||||
|
|
||||||
if clap_matches.is_present("database-path") {
|
if clap_matches.occurrences_of("database-path") > 0 {
|
||||||
config.database_path = options.database_path;
|
config.database_path = options.database_path.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
dbg!(&config);
|
||||||
println!("{:?}", config);
|
|
||||||
|
|
||||||
#[cfg(feature = "sqlite")]
|
#[cfg(feature = "sqlite")]
|
||||||
let mut sqlite_connection = RwLock::new(sqlite::connect(&config.database_path).await?);
|
let mut sqlite_connection = RwLock::new(sqlite::connect(&config.database_path).await?);
|
||||||
|
Loading…
Reference in New Issue
Block a user