mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
Publish gbafix
This commit is contained in:
parent
fc5ce97db4
commit
70979fc7da
|
@ -39,7 +39,9 @@ pub fn publish(matches: &ArgMatches) -> Result<(), Error> {
|
||||||
let mut published_crates: HashSet<String> = HashSet::new();
|
let mut published_crates: HashSet<String> = HashSet::new();
|
||||||
|
|
||||||
let dependencies = build_dependency_graph(&root_directory)?;
|
let dependencies = build_dependency_graph(&root_directory)?;
|
||||||
let crates_to_publish: Vec<_> = dependencies.keys().collect();
|
let mut crates_to_publish: Vec<_> = dependencies.keys().collect();
|
||||||
|
let agb_gbafix = "agb-gbafix".to_owned();
|
||||||
|
crates_to_publish.push(&agb_gbafix);
|
||||||
|
|
||||||
while published_crates.len() != crates_to_publish.len() {
|
while published_crates.len() != crates_to_publish.len() {
|
||||||
// find all crates which can be published now but haven't
|
// find all crates which can be published now but haven't
|
||||||
|
@ -47,12 +49,15 @@ pub fn publish(matches: &ArgMatches) -> Result<(), Error> {
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|&&crate_to_publish| !published_crates.contains(crate_to_publish))
|
.filter(|&&crate_to_publish| !published_crates.contains(crate_to_publish))
|
||||||
.filter(|&&crate_to_publish| {
|
.filter(|&&crate_to_publish| {
|
||||||
let dependencies_of_crate = &dependencies[crate_to_publish];
|
let dependencies_of_crate = &dependencies.get(crate_to_publish);
|
||||||
for dependency_of_crate in dependencies_of_crate {
|
|
||||||
|
if let Some(dependencies_of_crate) = dependencies_of_crate {
|
||||||
|
for dependency_of_crate in *dependencies_of_crate {
|
||||||
if !fully_published_crates.contains(dependency_of_crate) {
|
if !fully_published_crates.contains(dependency_of_crate) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
true
|
true
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue