mirror of
https://github.com/zyllian/zyllian.github.io.git
synced 2025-01-18 11:47:01 -08:00
Copy root files while serving
This commit is contained in:
parent
ef470c7fdd
commit
b44a40bffa
1 changed files with 5 additions and 1 deletions
|
@ -18,7 +18,7 @@ use warp::{
|
|||
Filter,
|
||||
};
|
||||
|
||||
use crate::{Site, SiteBuilder, PAGES_PATH, SASS_PATH, STATIC_PATH, TEMPLATES_PATH};
|
||||
use crate::{Site, SiteBuilder, PAGES_PATH, ROOT_PATH, SASS_PATH, STATIC_PATH, TEMPLATES_PATH};
|
||||
|
||||
fn with_build_path(
|
||||
build_path: PathBuf,
|
||||
|
@ -74,6 +74,8 @@ fn create(
|
|||
if build {
|
||||
builder.build_sass().context("Failed to rebuild Sass")?;
|
||||
}
|
||||
} else if let Ok(root_path) = relative_path.strip_prefix(ROOT_PATH) {
|
||||
std::fs::copy(&path, builder.build_path.join(root_path))?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
@ -106,6 +108,8 @@ fn remove(builder: &mut SiteBuilder, path: &Path, relative_path: &Path) -> anyho
|
|||
builder.build_sass().context("Failed to rebuild Sass")?;
|
||||
}
|
||||
|
||||
// Removing root files is not handled for the time being.
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue