Commit f309dace authored by nanahira's avatar nanahira

improve

parent bd7cbbab
Pipeline #598 passed with stages
in 6 minutes and 28 seconds
......@@ -54,15 +54,23 @@ function makeMatch(team1: Team, team2: Team): RenderData {
duels.push([memberLists[0][i], memberLists[1][i]]);
}
return {
teamNames: [team1.name, team2.name],
teamNames: [team1.name, team2.name].map(n => n.toUpperCase()),
timeString: moment().format("YYYY.MM.DD"),
duels
}
}
for (let match of config.matches) {
const team1 = _.find(config.teams, t => t.name === match.team1);
const team2 = _.find(config.teams, t => t.name === match.team2);
const team1 = _.find(config.teams, t => t.name.toUpperCase() === match.team1.toUpperCase());
if (!team1) {
console.error(`Missing team ${match.team1}`);
continue;
}
const team2 = _.find(config.teams, t => t.name.toUpperCase() === match.team2.toUpperCase());
if (!team2) {
console.error(`Missing team ${match.team2}`);
continue;
}
const data = makeMatch(team1, team2);
const renderedData = jinja.render(config.template, data);
console.log(renderedData);
......
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