fix: clone db_path before passing to db::open

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-16 12:19:32 -03:00
parent 12e0fa9aea
commit 8b8868760c

View File

@@ -2,7 +2,6 @@ mod args;
mod config;
mod modes;
use std::path::PathBuf;
use anyhow::{Context, Error, Result, anyhow};
use clap::*;
use clap::error::ErrorKind;
@@ -38,7 +37,7 @@ fn main() -> Result<(), Error> {
let proj_dirs = ProjectDirs::from("gt0.ca", "Andrew Phillips", "Keep");
let mut cmd = Args::command();
let mut args = Args::parse();
let args = Args::parse();
stderrlog::new()
.module(module_path!())
@@ -166,7 +165,7 @@ fn main() -> Result<(), Error> {
.with_context(|| format!("Unable to create data directory {:?}", data_path))?;
// Initialize database
let mut conn = db::open(db_path)?;
let mut conn = db::open(db_path.clone())?;
match mode {
KeepModes::Save => modes::save::mode_save(&mut cmd, &settings, ids, tags, &mut conn, data_path),