MCPcopy Create free account
hub / github.com/bytecodealliance/wstd / find_crates

Function find_crates

ci/publish.rs:107–125  ·  view source on GitHub ↗
(dir: &Path, ws: &Workspace, dst: &mut Vec<Crate>)

Source from the content-addressed store, hash-verified

105}
106
107fn find_crates(dir: &Path, ws: &Workspace, dst: &mut Vec<Crate>) {
108 if dir.join("Cargo.toml").exists() {
109 let krate = read_crate(Some(ws), &dir.join("Cargo.toml"));
110 if CRATES_TO_IGNORE.iter().any(|c| krate.name == *c) {
111 // Ignore!
112 } else if !krate.publish || CRATES_TO_PUBLISH.iter().any(|c| krate.name == *c) {
113 dst.push(krate);
114 } else {
115 panic!("failed to find {:?} in whitelist or blacklist", krate.name);
116 }
117 }
118
119 for entry in dir.read_dir().unwrap() {
120 let entry = entry.unwrap();
121 if entry.file_type().unwrap().is_dir() {
122 find_crates(&entry.path(), ws, dst);
123 }
124 }
125}
126
127fn read_crate(ws: Option<&Workspace>, manifest: &Path) -> Crate {
128 let mut name = None;

Callers 1

mainFunction · 0.85

Calls 1

read_crateFunction · 0.85

Tested by

no test coverage detected