Resolve a possibly-bundle-relative path to an absolute filesystem path. On watchOS the Swift shell populates `BUNDLE_RESOURCE_PATH` on startup via `bloom_watchos_set_bundle_path`; if it hasn't, paths are returned unchanged.
(p: &str)
| 145 | /// via `bloom_watchos_set_bundle_path`; if it hasn't, paths are returned |
| 146 | /// unchanged. |
| 147 | pub fn resolve_bundle_path(p: &str) -> String { |
| 148 | if p.starts_with('/') { |
| 149 | return p.to_string(); |
| 150 | } |
| 151 | let bundle = BUNDLE_PATH.lock().unwrap(); |
| 152 | if bundle.is_empty() { |
| 153 | return p.to_string(); |
| 154 | } |
| 155 | format!("{}/{}", bundle, p) |
| 156 | } |
| 157 | |
| 158 | static BUNDLE_PATH: Mutex<String> = Mutex::new(String::new()); |
| 159 |
no outgoing calls
no test coverage detected