瀏覽代碼

chore: add debug feature

GyDi 3 年之前
父節點
當前提交
5b9e078061
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 1 0
      src-tauri/Cargo.toml
  2. 5 1
      src-tauri/src/utils/dirs.rs

+ 1 - 0
src-tauri/Cargo.toml

@@ -42,6 +42,7 @@ winreg = { version = "0.10", features = ["transactions"] }
 default = [ "custom-protocol" ]
 custom-protocol = [ "tauri/custom-protocol" ]
 verge-dev = []
+debug-yml = []
 
 [profile.release]
 panic = "abort"

+ 5 - 1
src-tauri/src/utils/dirs.rs

@@ -53,5 +53,9 @@ pub fn profiles_path() -> PathBuf {
 }
 
 pub fn profiles_temp_path() -> PathBuf {
-  temp_dir().join(PROFILE_TEMP)
+  #[cfg(not(feature = "debug-yml"))]
+  return temp_dir().join(PROFILE_TEMP);
+
+  #[cfg(feature = "debug-yml")]
+  return app_home_dir().join(PROFILE_TEMP);
 }