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
40
41
//! Configuration helper functions and utilities.
//!
//! This module provides utility functions for working with the unified configuration.
use PathBuf;
/// Default path for the unified configuration file.
pub const DEFAULT_UNIFIED_CONFIG_NAME: &str = "ralph-workflow.toml";
/// Get the path to the unified config file.
///
/// Returns `~/.config/ralph-workflow.toml` by default.
///
/// If `XDG_CONFIG_HOME` is set, uses `{XDG_CONFIG_HOME}/ralph-workflow.toml`.
///
/// # Returns
///
/// - `Some(PathBuf)` with the config path if the home directory can be determined
/// - `None` if the home directory cannot be determined
///
/// # Examples
///
/// ```rust
/// use ralph_workflow::config::unified::unified_config_path;
///
/// if let Some(path) = unified_config_path() {
/// println!("Config path: {}", path.display());
/// }
/// ```