Skip to content

Commit

Permalink
Change db path depending on profile
Browse files Browse the repository at this point in the history
This is to make it easier to test development builds without affecting
the main installation.
  • Loading branch information
matzipan committed Nov 12, 2023
1 parent 6ba41b9 commit 3b0310b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/services/store.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use crate::backends;
use crate::config::PROFILE;
use crate::controllers::ApplicationProfile;
use crate::models;
use crate::schema;

Expand Down Expand Up @@ -54,7 +56,10 @@ fn get_database_path() -> Option<String> {
.and_then(allow_only_absolute)
.map(|path| path.join(".local/share"))
})
.map(|path| path.join("db.sqlite"))
.map(|path| match PROFILE {
ApplicationProfile::Default => path.join("db.sqlite"),
ApplicationProfile::Devel => path.join("db-devel.sqlite"),
})
.map(|path| path.into_os_string().into_string().unwrap())
}

Expand Down

0 comments on commit 3b0310b

Please sign in to comment.