Skip to content

Commit

Permalink
conditional path depending on users os
Browse files Browse the repository at this point in the history
  • Loading branch information
Piyuuussshhh committed Sep 18, 2024
1 parent f446949 commit b384f10
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src-tauri/src/db/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ pub fn init(path: &str) -> Connection {
create_db(path);
}

// TODO conditional path for diff OS
let db_name = format!("{path}/database.sqlite");
let db_name = if std::env::consts::OS == "windows" {
format!("{}\\database.sqlite", path)
} else {
format!("{}/database.sqlite", path)
};

match Connection::open(db_name) {
Ok(conn) => conn,
Expand Down

0 comments on commit b384f10

Please sign in to comment.