30 lines
744 B
Rust
30 lines
744 B
Rust
use serde::{Deserialize, Serialize};
|
|
use std::{env, fs};
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
struct Config {
|
|
input_path: String,
|
|
gemini_output_path: String,
|
|
html_output_path: String,
|
|
}
|
|
|
|
fn main() {
|
|
let conf_path = env::args()
|
|
.nth(1)
|
|
.expect("first argument must be config file path");
|
|
|
|
println!("Loading config file");
|
|
|
|
let conf_str = fs::read_to_string(&conf_path)
|
|
.expect("failed to read config file {conf_path}");
|
|
let conf : Config = serde_yaml::from_str(&conf_str)
|
|
.expect("invalid config format");
|
|
|
|
|
|
let input_paths = fs::read_dir(conf.input_path).unwrap();
|
|
|
|
for path in input_paths {
|
|
println!("{}", path.unwrap().path().display())
|
|
}
|
|
}
|