From 8ea3e6fa26e2a747374e0cd2d79e316a26a78dbf Mon Sep 17 00:00:00 2001
From: GyDi <segydi@foxmail.com>
Date: Mon, 7 Mar 2022 01:06:21 +0800
Subject: [PATCH] fix: create dir panic

---
 src-tauri/src/utils/init.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src-tauri/src/utils/init.rs b/src-tauri/src/utils/init.rs
index 885dc34..991bdcf 100644
--- a/src-tauri/src/utils/init.rs
+++ b/src-tauri/src/utils/init.rs
@@ -67,13 +67,13 @@ pub fn init_app(package_info: &PackageInfo) {
   let res_dir = dirs::app_resources_dir(package_info);
 
   if !app_dir.exists() {
-    fs::create_dir(&app_dir).unwrap();
+    fs::create_dir_all(&app_dir).unwrap();
   }
   if !log_dir.exists() {
-    fs::create_dir(&log_dir).unwrap();
+    fs::create_dir_all(&log_dir).unwrap();
   }
   if !profiles_dir.exists() {
-    fs::create_dir(&profiles_dir).unwrap();
+    fs::create_dir_all(&profiles_dir).unwrap();
   }
 
   init_log(&log_dir);
-- 
GitLab