Commit 4903124e authored by nanahira's avatar nanahira

display missings at last

parent 7fd6abfa
Pipeline #601 passed with stages
in 5 minutes and 30 seconds
......@@ -59,15 +59,15 @@ function makeMatch(team1: Team, team2: Team): RenderData {
duels
}
}
const missingTeams: string[] = [];
for (let match of config.matches) {
const team1 = _.find(config.teams, t => t.name.toUpperCase() === match.team1.toUpperCase());
if (!team1) {
console.error(`Missing team ${match.team1}.`);
missingTeams.push(match.team1);
}
const team2 = _.find(config.teams, t => t.name.toUpperCase() === match.team2.toUpperCase());
if (!team2) {
console.error(`Missing team ${match.team2}.`);
missingTeams.push(match.team2);
}
if (!team1 || !team2) {
continue;
......@@ -77,3 +77,6 @@ for (let match of config.matches) {
console.log(renderedData);
console.log("");
}
for (let missingName of missingTeams) {
console.error(`Missing team ${missingName}.`);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment