Gets path to the current dsc process. If dsc is started using a symlink, this functon returns target of the symlink. # Errors Will return `Err` if path to the current exe can't be retrived.
()
| 187 | /// |
| 188 | /// Will return `Err` if path to the current exe can't be retrived. |
| 189 | pub fn get_exe_path() -> Result<PathBuf, DscError> { |
| 190 | if let Ok(exe) = env::current_exe() { |
| 191 | if let Ok(target_path) = fs::read_link(exe.clone()) { |
| 192 | return Ok(target_path); |
| 193 | } |
| 194 | |
| 195 | return Ok(exe); |
| 196 | } |
| 197 | |
| 198 | Err(DscError::NotSupported(t!("util.failedToGetExePath").to_string())) |
| 199 | } |
| 200 | |
| 201 | #[cfg(target_os = "windows")] |
| 202 | fn get_settings_policy_file_path() -> String |
no outgoing calls
no test coverage detected