From db6a962c7598b82b66093858b51baba5d1c6ab9e Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Wed, 13 Aug 2025 17:05:18 +0300 Subject: [PATCH 1/2] stash: create database directory automatically if missing Oops. Signed-off-by: NotAShelf Change-Id: I6a6a6964866a1711971322c81ea194aa062466da --- src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.rs b/src/main.rs index 0e8128f..f41ccac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -107,6 +107,13 @@ fn main() { .join("db") }); + if let Some(parent) = db_path.parent() { + if let Err(e) = std::fs::create_dir_all(parent) { + log::error!("Failed to create database directory: {e}"); + process::exit(1); + } + } + let conn = rusqlite::Connection::open(&db_path).unwrap_or_else(|e| { log::error!("Failed to open SQLite database: {e}"); process::exit(1); From 1905f3888510f059d16d3ae9c2d7924c0bd1429f Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Wed, 13 Aug 2025 17:06:58 +0300 Subject: [PATCH 2/2] chore: bump crate version Signed-off-by: NotAShelf Change-Id: I6a6a6964fe753338359cc56ed84615bee23b8d58 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index efbc845..1928763 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -953,7 +953,7 @@ dependencies = [ [[package]] name = "stash" -version = "0.2.2" +version = "0.2.3" dependencies = [ "base64", "clap", diff --git a/Cargo.toml b/Cargo.toml index 66772a1..71ff39c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stash" -version = "0.2.2" +version = "0.2.3" edition = "2024" authors = ["NotAShelf "] license = "MPL-2.0"