Skip to content

Commit

Permalink
fail in case nothing to run was found
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jul 11, 2017
1 parent d84693b commit 0cf8f85
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/bootstrap/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

use std::collections::{BTreeMap, HashSet, HashMap};
use std::mem;
use std::path::PathBuf;
use std::process;

use check::{self, TestKind};
Expand Down Expand Up @@ -1209,11 +1210,19 @@ invalid rule dependency graph detected, was a rule added and maybe typo'd?
if paths.len() == 0 && rule.default {
Some((rule, 0))
} else {
paths.iter().position(|path| path.ends_with(rule.path))
paths.iter()
.position(|path| path.ends_with(rule.path))
.map(|priority| (rule, priority))
}
}).collect();

if rules.is_empty() &&
!paths.get(0).unwrap_or(&PathBuf::new())
.ends_with("nonexistent/path/to/trigger/cargo/metadata") {
println!("\nNothing to run...\n");
process::exit(1);
}

rules.sort_by_key(|&(_, priority)| priority);

rules.into_iter().flat_map(|(rule, _)| {
Expand Down

0 comments on commit 0cf8f85

Please sign in to comment.