Get the path to the configuration file, following the XDG Base Directory Specification at https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html If config_name is None, returns ~/.config/codspeed/config.yaml (default) If config_name is Some, returns ~/.config/codspeed/{config_name}.yaml
(config_name: Option<&str>)
| 126 | /// If config_name is None, returns ~/.config/codspeed/config.yaml (default) |
| 127 | /// If config_name is Some, returns ~/.config/codspeed/{config_name}.yaml |
| 128 | fn get_configuration_file_path(config_name: Option<&str>) -> PathBuf { |
| 129 | let config_dir = env::var("XDG_CONFIG_HOME") |
| 130 | .map(PathBuf::from) |
| 131 | .unwrap_or_else(|_| { |
| 132 | let home = env::var("HOME").expect("HOME env variable not set"); |
| 133 | PathBuf::from(home).join(".config") |
| 134 | }); |
| 135 | let config_dir = config_dir.join("codspeed"); |
| 136 | |
| 137 | match config_name { |
| 138 | Some(name) => config_dir.join(format!("{name}.yaml")), |
| 139 | None => config_dir.join("config.yaml"), |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | impl CodSpeedConfig { |
| 144 | /// Wrap a [`PersistedConfig`] with placeholder runtime values. The |
no outgoing calls
no test coverage detected