()
| 135 | } |
| 136 | |
| 137 | fn detect_from_exe() -> Option<String> { |
| 138 | let exe = std::env::current_exe().ok()?; |
| 139 | let exe_dir = exe.parent()?; |
| 140 | |
| 141 | let mut candidates: Vec<PathBuf> = Vec::new(); |
| 142 | |
| 143 | if cfg!(target_os = "macos") { |
| 144 | // Primary: tauri.conf.json maps dist -> mobile-web/dist in Resources |
| 145 | candidates.push(exe_dir.join("../Resources/mobile-web/dist")); |
| 146 | // Fallback: legacy layout without dist subdirectory |
| 147 | candidates.push(exe_dir.join("../Resources/mobile-web")); |
| 148 | // Fallback: array-format bundling may place files at Resources/dist directly |
| 149 | candidates.push(exe_dir.join("../Resources/dist")); |
| 150 | } |
| 151 | candidates.push(exe_dir.join("mobile-web/dist")); |
| 152 | candidates.push(exe_dir.join("mobile-web")); |
| 153 | candidates.push(exe_dir.join("resources/mobile-web/dist")); |
| 154 | candidates.push(exe_dir.join("resources/mobile-web")); |
| 155 | |
| 156 | if cfg!(target_os = "linux") { |
| 157 | candidates.push(exe_dir.join("../lib/bitfun/mobile-web/dist")); |
| 158 | candidates.push(exe_dir.join("../lib/bitfun/mobile-web")); |
| 159 | candidates.push(exe_dir.join("../share/bitfun/mobile-web/dist")); |
| 160 | candidates.push(exe_dir.join("../share/bitfun/mobile-web")); |
| 161 | candidates.push(exe_dir.join("../share/com.bitfun.desktop/mobile-web/dist")); |
| 162 | candidates.push(exe_dir.join("../share/com.bitfun.desktop/mobile-web")); |
| 163 | } |
| 164 | |
| 165 | check_candidates(&candidates, "exe-relative") |
| 166 | } |
| 167 | |
| 168 | fn detect_from_cwd() -> Option<String> { |
| 169 | let cwd = std::env::current_dir().ok()?; |
no test coverage detected