MCPcopy Create free account
hub / github.com/GCWing/BitFun / check_candidates

Function check_candidates

src/apps/desktop/src/api/remote_connect_api.rs:179–189  ·  view source on GitHub ↗
(candidates: &[PathBuf], source: &str)

Source from the content-addressed store, hash-verified

177}
178
179fn check_candidates(candidates: &[PathBuf], source: &str) -> Option<String> {
180 for candidate in candidates {
181 if is_valid_mobile_web_dir(candidate) {
182 if let Ok(abs) = candidate.canonicalize() {
183 log::info!("Detected mobile-web dir ({}): {}", source, abs.display());
184 return Some(abs.to_string_lossy().into_owned());
185 }
186 }
187 }
188 None
189}
190
191fn is_valid_mobile_web_dir(dir: &std::path::Path) -> bool {
192 dir.join("index.html").exists() && dir.join("assets").is_dir()

Callers 2

detect_from_exeFunction · 0.85
detect_from_cwdFunction · 0.85

Calls 1

is_valid_mobile_web_dirFunction · 0.85

Tested by

no test coverage detected