Commit e62879bf authored by Robert Czechowski's avatar Robert Czechowski
Browse files

Read contests in same directory in lexical order, do not crash if directory ends in '.yaml' --amend

parent 031094e9
...@@ -82,6 +82,9 @@ fn read_contest(p: &Path) -> Option<Contest> { ...@@ -82,6 +82,9 @@ fn read_contest(p: &Path) -> Option<Contest> {
fn get_all_contest_info(task_dir: &str) -> Vec<Contest> { fn get_all_contest_info(task_dir: &str) -> Vec<Contest> {
fn walk_me_recursively(p: &Path, contests: &mut Vec<Contest>) { fn walk_me_recursively(p: &Path, contests: &mut Vec<Contest>) {
if let Ok(paths) = std::fs::read_dir(p) { if let Ok(paths) = std::fs::read_dir(p) {
use std::io::Write;
let mut paths: Vec<_> = paths.filter_map(|r| r.ok()).collect(); let mut paths: Vec<_> = paths.filter_map(|r| r.ok()).collect();
paths.sort_by_key(|dir| dir.path()); paths.sort_by_key(|dir| dir.path());
for path in paths { for path in paths {
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