Finds the tracedecay binary path. On Windows the returned path uses forward slashes so it can be safely embedded in JSON hook commands without backslash-escaping issues.
()
| 736 | /// On Windows the returned path uses forward slashes so it can be safely |
| 737 | /// embedded in JSON hook commands without backslash-escaping issues. |
| 738 | pub fn which_tracedecay() -> Option<String> { |
| 739 | let current_exe = std::env::current_exe().ok(); |
| 740 | let path_var = std::env::var_os("PATH"); |
| 741 | let cargo_target_dir = std::env::var_os("CARGO_TARGET_DIR").map(PathBuf::from); |
| 742 | which_tracedecay_from( |
| 743 | current_exe.as_deref(), |
| 744 | path_var.as_deref(), |
| 745 | cargo_target_dir.as_deref(), |
| 746 | ) |
| 747 | } |
| 748 | |
| 749 | fn which_tracedecay_from( |
| 750 | current_exe: Option<&Path>, |