|
|
|
@ -67,6 +67,10 @@ pub fn get_submission_data(challenge: i32) -> Vec<Value> {
|
|
|
|
|
json
|
|
|
|
|
}
|
|
|
|
|
Err(ref e) if e.kind() == std::io::ErrorKind::NotFound => {
|
|
|
|
|
// Create parent directory if not exists
|
|
|
|
|
if let Some(parent_dir) = std::path::Path::new(&submission_data_path).parent() {
|
|
|
|
|
fs::create_dir_all(parent_dir).unwrap();
|
|
|
|
|
}
|
|
|
|
|
let mut file = File::create(&submission_data_path).unwrap();
|
|
|
|
|
file.write_all(b"[]").unwrap();
|
|
|
|
|
file.flush().unwrap();
|
|
|
|
|