Skip to content

Commit 9d36201

Browse files
committed
fix(core): allow project-only scans even if project is unparseable
1 parent caaf604 commit 9d36201

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

src/core/engine.rs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,22 @@ impl Engine {
6363
let extracted_ipa = extract_ipa(path)?;
6464

6565
// Attempt to discover project metadata during extraction
66-
let discovered_project = extracted_ipa
66+
let discovered_project_path = extracted_ipa
6767
.get_project_path()
68-
.map_err(|e| OrchestratorError::Extraction(ExtractionError::Io(e)))?
69-
.and_then(|p| {
70-
if p.extension().is_some_and(|e| e == "xcworkspace") {
71-
crate::parsers::xcworkspace_parser::Xcworkspace::from_path(&p)
72-
.ok()
73-
.and_then(|ws| ws.project_paths.first().cloned())
74-
.and_then(|proj_path| {
75-
crate::parsers::xcode_parser::XcodeProject::from_path(proj_path).ok()
76-
})
77-
} else {
78-
crate::parsers::xcode_parser::XcodeProject::from_path(p).ok()
79-
}
80-
});
68+
.map_err(|e| OrchestratorError::Extraction(ExtractionError::Io(e)))?;
69+
70+
let discovered_project = discovered_project_path.as_ref().and_then(|p| {
71+
if p.extension().is_some_and(|e| e == "xcworkspace") {
72+
crate::parsers::xcworkspace_parser::Xcworkspace::from_path(p)
73+
.ok()
74+
.and_then(|ws| ws.project_paths.first().cloned())
75+
.and_then(|proj_path| {
76+
crate::parsers::xcode_parser::XcodeProject::from_path(proj_path).ok()
77+
})
78+
} else {
79+
crate::parsers::xcode_parser::XcodeProject::from_path(p).ok()
80+
}
81+
});
8182

8283
let app_bundle_path = extracted_ipa
8384
.get_app_bundle_path()
@@ -88,7 +89,7 @@ impl Engine {
8889
None => {
8990
// If we found a project but no .app, we can still proceed with the extraction root
9091
// as a context and let rules that check project metadata run.
91-
if discovered_project.is_some() {
92+
if discovered_project_path.is_some() {
9293
extracted_ipa.payload_dir.clone()
9394
} else {
9495
let mut entries = Vec::new();

0 commit comments

Comments
 (0)