mirror of
https://github.com/NotAShelf/stash.git
synced 2026-04-13 14:33:47 +00:00
stash: create database directory automatically if missing
Oops. Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6a6a6964866a1711971322c81ea194aa062466da
This commit is contained in:
parent
fe5101809b
commit
db6a962c75
1 changed files with 7 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue