feat: handle category without repos
This is a dirty hack, but we won't have to duplicate it when the kinds field is done, so I don't feel /too/ bad about including it :D Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
parent
ad569e23ba
commit
105d96a601
1 changed files with 6 additions and 1 deletions
|
@ -600,8 +600,13 @@ impl Config {
|
||||||
/// ];
|
/// ];
|
||||||
/// ```
|
/// ```
|
||||||
pub fn all_on_all(&self, closures: Vec<SeriesItem>, break_on_err: bool) {
|
pub fn all_on_all(&self, closures: Vec<SeriesItem>, break_on_err: bool) {
|
||||||
|
// HACK: creates a empty repo, that is used if a category doesn't have
|
||||||
|
// any repos or don't define the repo field
|
||||||
|
let tmp: HashMap<String, Repo> = HashMap::new();
|
||||||
|
|
||||||
for category in self.categories.values() {
|
for category in self.categories.values() {
|
||||||
for (_, repo) in category.repos.as_ref().expect("failed to get repos").iter() {
|
// HACK: if the repo doesn't exist here, we inject tmp
|
||||||
|
for (_, repo) in category.repos.as_ref().unwrap_or_else(|| &tmp).iter() {
|
||||||
use RepoKinds::*;
|
use RepoKinds::*;
|
||||||
match &repo.kind {
|
match &repo.kind {
|
||||||
Some(GitRepo) => {
|
Some(GitRepo) => {
|
||||||
|
|
Loading…
Reference in a new issue