Do not output anything when no repos found

This commit is contained in:
2021-11-22 20:27:17 +01:00
parent 12cb18c528
commit 77c00cee5f

View File

@@ -631,13 +631,19 @@ pub fn run() {
process::exit(1);
}
let config = Config {
trees: vec![find_in_tree(path).unwrap()],
};
let trees = vec![find_in_tree(path).unwrap()];
if trees.iter().all(|t| match &t.repos {
None => false,
Some(r) => r.is_empty(),
}) {
print_warning("No repositories found");
} else {
let config = Config { trees };
let toml = toml::to_string(&config).unwrap();
let toml = toml::to_string(&config).unwrap();
print!("{}", toml);
print!("{}", toml);
}
}
cmd::SubCommand::Worktree(args) => {
let dir = match std::env::current_dir() {