Skip to content

Commit ea89104

Browse files
Merge pull request #29 from Lemonnnnnnnnnnn/master
fix: 处理 macos 下的路径问题
2 parents f5407e3 + 669e2f6 commit ea89104

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src-tauri/src/services/global_config.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ pub fn init_config(app_handle: &AppHandle) -> Result<(), io::Error> {
2121
return Ok(());
2222
}
2323

24+
let path = get_local_data_dir(app_handle).unwrap().join(CONFIG_NAME);
25+
26+
// create dir
27+
if let Some(parent) = path.parent() {
28+
std::fs::create_dir_all(parent)?;
29+
}
30+
2431
let mut file = OpenOptions::new()
2532
.write(true)
2633
.create_new(true)

0 commit comments

Comments
 (0)