You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
791 B

use std::fs;
use serde_json::Value;
fn main(){
let json_string = fs::read_to_string("boards/coding.json").expect("unable to read file");
let output_dir = "output";
fs::create_dir(output_dir).expect("uable to create dir");
let json_data: Value = serde_json::from_str(&json_string).unwrap();
let board_dir = output_dir.to_owned() + "/" + json_data["name"].as_str().unwrap();
fs::create_dir(&board_dir).expect("unable to create dir");
if let Value::Array(lists) = &json_data["lists"]{
// Iterate over the elements in the array
for list in lists {
fs::create_dir(board_dir.clone() + "/" + list["name"].as_str().unwrap()).expect("unable to create dir");
//println!("{}", list["name"].as_str().unwrap());
}
}
}