diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-01-08 02:17:28 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-01-08 02:17:28 +0800 |
| commit | 7977f2dae409538300c299a7bb573e8832e2563c (patch) | |
| tree | d3e3d01b91d8fc105b39be9411e88ccf2bc28d89 /crates | |
| parent | f97ad6f00c4d526b710171cf611bd582f6f9f8ac (diff) | |
Use different config directory name on non-Linux systems
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/vcs_data/src/current.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/vcs_data/src/current.rs b/crates/vcs_data/src/current.rs index 0a225d2..209c0cc 100644 --- a/crates/vcs_data/src/current.rs +++ b/crates/vcs_data/src/current.rs @@ -72,7 +72,13 @@ pub fn find_local_path(path: impl Into<PathBuf>) -> Option<PathBuf> { None } -/// Get the system's document directory and join with jvcs +/// Get the system's document directory and join with the appropriate application name pub fn current_cfg_dir() -> Option<PathBuf> { - dirs::config_local_dir().map(|path| path.join("jvcs")) + dirs::config_local_dir().map(|path| { + if cfg!(target_os = "linux") { + path.join("jvcs") + } else { + path.join("JustEnoughVCS") + } + }) } |
