Skip to content

Commit c93e7c0

Browse files
committed
ref: only create via xcodeproj_folder
1 parent b5ddde2 commit c93e7c0

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

src/lib.rs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#![deny(rustdoc::broken_intra_doc_links)]
66
#![doc = include_str!("../README.md")]
77

8-
use anyhow::{bail, Context, Result};
8+
use anyhow::Result;
99
use pbxproj::PBXRootObject;
1010
use std::path::{Path, PathBuf};
1111

@@ -23,25 +23,8 @@ pub struct XCodeProject {
2323
}
2424

2525
impl XCodeProject {
26-
/// Create new XCodeProject object from project root
27-
pub fn new<P: AsRef<Path>>(root: P) -> Result<Self> {
28-
let matches = wax::walk("*.xcodeproj", &root)
29-
.context("Glob")?
30-
.flatten()
31-
.map(|entry| entry.into_path())
32-
.collect::<Vec<PathBuf>>();
33-
34-
let path = if matches.is_empty() {
35-
bail!("No Xcodeproj found at {:#?}", root.as_ref());
36-
} else {
37-
&matches[0]
38-
};
39-
40-
Self::new_from_xcodeproj_folder(path)
41-
}
42-
4326
/// Create new XCodeProject object from xcodeproj_folder
44-
pub fn new_from_xcodeproj_folder<P: AsRef<Path>>(xcodeproj_folder: P) -> Result<Self> {
27+
pub fn new<P: AsRef<Path>>(xcodeproj_folder: P) -> Result<Self> {
4528
let xcodeproj_folder = xcodeproj_folder.as_ref();
4629
let pbxproj_path = xcodeproj_folder.join("project.pbxproj");
4730

0 commit comments

Comments
 (0)