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