()
| 722 | } |
| 723 | |
| 724 | fn package_managed_tls_dirs() -> Vec<PathBuf> { |
| 725 | if let Some(path) = std::env::var_os("OPENSHELL_LOCAL_TLS_DIR") { |
| 726 | return vec![PathBuf::from(path)]; |
| 727 | } |
| 728 | |
| 729 | let mut dirs = Vec::new(); |
| 730 | |
| 731 | if cfg!(target_os = "macos") { |
| 732 | dirs.push(PathBuf::from("/opt/homebrew/var/openshell/tls")); |
| 733 | dirs.push(PathBuf::from("/usr/local/var/openshell/tls")); |
| 734 | } |
| 735 | |
| 736 | let state_dir = std::env::var_os("XDG_STATE_HOME") |
| 737 | .map(PathBuf::from) |
| 738 | .or_else(|| std::env::var_os("HOME").map(|home| PathBuf::from(home).join(".local/state"))); |
| 739 | if let Some(state_dir) = state_dir { |
| 740 | dirs.push(state_dir.join("openshell/tls")); |
| 741 | } |
| 742 | |
| 743 | dirs |
| 744 | } |
| 745 | |
| 746 | fn import_local_package_mtls_bundle(name: &str) -> Result<Option<PathBuf>> { |
| 747 | for dir in package_managed_tls_dirs() { |
no test coverage detected