add arguments
This commit is contained in:
parent
02049b6d33
commit
6de1607e2d
25
src/main.rs
25
src/main.rs
@ -1,5 +1,4 @@
|
||||
use std::{path::Path};
|
||||
use std::fs;
|
||||
use std::{path::Path, fs, env};
|
||||
use minijinja::Environment;
|
||||
|
||||
mod render;
|
||||
@ -48,9 +47,27 @@ fn render_index(out_path: &Path, index: &IndexItem, cur_path: &Path, site_index:
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
||||
let mut src_path_str: String = SRC_PATH.to_string();
|
||||
let mut out_path_str: String = OUT_PATH.to_string();
|
||||
|
||||
let src_path = Path::new(SRC_PATH);
|
||||
let out_path = Path::new(OUT_PATH);
|
||||
let mut i: u8 = 0;
|
||||
for arg in env::args() {
|
||||
match i {
|
||||
0 => {}
|
||||
1 => {
|
||||
src_path_str = arg;
|
||||
}
|
||||
2 => {
|
||||
out_path_str = arg;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
|
||||
let src_path = Path::new(&src_path_str);
|
||||
let out_path = Path::new(&out_path_str);
|
||||
|
||||
let index = Renderer::index(src_path).unwrap();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user