~/website

188f63837cd1966c151efc7b742436f1e3a179f2 — Arthur Melton 0fd9e0c1 2 years ago
actually make the folders
1 files changed, 3 insertions(+), 2 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +3 -2
@@ 31,11 31,12 @@ fn main() {

        if e.metadata().unwrap().is_file() {
            let mut path = e.path();
            path = path.strip_prefix("static/").unwrap(); // should never fail
            let mut parent = path.to_path_buf();
            let new_path = Path::new("public").join(path);
            let mut parent = new_path.to_path_buf();
            parent.pop();
            fs::create_dir_all(parent.clone())
                .unwrap_or_else(|_| panic!("Cant make the folders {}", parent.display()));
            fs::copy(e.path(), Path::new("public").join(path)).unwrap_or_else(|_| {
            fs::copy(e.path(), new_path).unwrap_or_else(|_| {
                panic!(
                    "failed to copy static/{} to public/{}",
                    path.display(),