-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_identity.rs
More file actions
39 lines (33 loc) · 1.12 KB
/
app_identity.rs
File metadata and controls
39 lines (33 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright © 2025-2026 OpenVCS Contributors
// SPDX-License-Identifier: GPL-3.0-or-later
//! Channel-aware desktop identity and persistence paths.
use directories::ProjectDirs;
/// Returns the filesystem app name used for persistence.
///
/// All desktop channels intentionally share the historical `OpenVCS`
/// directory so builds keep using the same config and plugin roots.
///
/// # Returns
/// - Application name for `ProjectDirs`.
pub fn persistence_name() -> &'static str {
"OpenVCS"
}
/// Returns channel-aware project directories for app config and data.
///
/// All desktop channels preserve the legacy `OpenVCS` application name so
/// existing users keep the same config and data roots.
///
/// # Returns
/// - `Some(ProjectDirs)` when the platform exposes standard app directories.
/// - `None` when no platform-specific directories are available.
pub fn project_dirs() -> Option<ProjectDirs> {
ProjectDirs::from("dev", "OpenVCS", persistence_name())
}
#[cfg(test)]
mod tests {
use super::persistence_name;
#[test]
fn exposes_persistence_names() {
assert_eq!(persistence_name(), "OpenVCS");
}
}