pull/30/head
Jonas Kruckenberg 3 years ago
parent 36698d1436
commit 64aed34eff

1
Cargo.lock generated

@ -4200,6 +4200,7 @@ dependencies = [
"log 0.4.17", "log 0.4.17",
"serde", "serde",
"serde_json", "serde_json",
"serde_repr",
"tauri", "tauri",
"thiserror", "thiserror",
] ]

@ -252,7 +252,7 @@ impl LoggerBuilder {
LogTarget::Stderr => fern::Output::from(std::io::stderr()), LogTarget::Stderr => fern::Output::from(std::io::stderr()),
LogTarget::Folder(path) => { LogTarget::Folder(path) => {
if !path.exists() { if !path.exists() {
fs::create_dir_all(&path).unwrap(); fs::create_dir_all(path).unwrap();
} }
fern::log_file(get_log_file_path( fern::log_file(get_log_file_path(
@ -264,7 +264,7 @@ impl LoggerBuilder {
.into() .into()
} }
LogTarget::LogDir => { LogTarget::LogDir => {
let path = app_handle.path_resolver().log_dir().unwrap(); let path = app_handle.path_resolver().app_log_dir().unwrap();
if !path.exists() { if !path.exists() {
fs::create_dir_all(&path).unwrap(); fs::create_dir_all(&path).unwrap();
} }

@ -40,7 +40,7 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
#[cfg(feature = "protocol-asset")] #[cfg(feature = "protocol-asset")]
let asset_protocol_scope = app.asset_protocol_scope(); let asset_protocol_scope = app.asset_protocol_scope();
let app = app.clone(); let app = app.clone();
let app_dir = app.path_resolver().app_dir(); let app_dir = app.path_resolver().app_data_dir();
if let Some(app_dir) = app_dir { if let Some(app_dir) = app_dir {
let scope_state_path = app_dir.join(SCOPE_STATE_FILENAME); let scope_state_path = app_dir.join(SCOPE_STATE_FILENAME);

@ -13,6 +13,7 @@ serde_json.workspace = true
tauri.workspace = true tauri.workspace = true
log.workspace = true log.workspace = true
thiserror.workspace = true thiserror.workspace = true
serde_repr = "0.1"
[features] [features]
system-tray = [ "tauri/system-tray" ] system-tray = [ "tauri/system-tray" ]

@ -172,7 +172,7 @@ impl Store {
pub fn load<R: Runtime>(&mut self, app: &AppHandle<R>) -> Result<(), Error> { pub fn load<R: Runtime>(&mut self, app: &AppHandle<R>) -> Result<(), Error> {
let app_dir = app let app_dir = app
.path_resolver() .path_resolver()
.app_dir() .app_data_dir()
.expect("failed to resolve app dir"); .expect("failed to resolve app dir");
let store_path = app_dir.join(&self.path); let store_path = app_dir.join(&self.path);
@ -187,7 +187,7 @@ impl Store {
pub fn save<R: Runtime>(&self, app: &AppHandle<R>) -> Result<(), Error> { pub fn save<R: Runtime>(&self, app: &AppHandle<R>) -> Result<(), Error> {
let app_dir = app let app_dir = app
.path_resolver() .path_resolver()
.app_dir() .app_data_dir()
.expect("failed to resolve app dir"); .expect("failed to resolve app dir");
let store_path = app_dir.join(&self.path); let store_path = app_dir.join(&self.path);

Loading…
Cancel
Save