Skip to content

Commit 279f2a1

Browse files
committed
fix static file copy leaving static.files dir in.
1 parent dba790d commit 279f2a1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bin/builder.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,14 +316,15 @@ fn main() -> io::Result<()> {
316316
if !copy_done {
317317
fs::create_dir_all(static_path).unwrap();
318318
// recursive copy
319-
let mut stack = vec![doc_dir.join("static.files")];
319+
let doc_static_dir = doc_dir.join("static.files");
320+
let mut stack = vec![doc_static_dir.clone()];
320321
while let Some(path) = stack.pop() {
321322
if path.is_dir() {
322323
for entry in fs::read_dir(path).unwrap() {
323324
stack.push(entry.unwrap().path());
324325
}
325326
} else {
326-
let rel_path = path.strip_prefix(&doc_dir).unwrap();
327+
let rel_path = path.strip_prefix(&doc_static_dir).unwrap();
327328
let target_path = static_path.join(rel_path);
328329
let _ = fs::create_dir_all(target_path.parent().unwrap());
329330
fs::copy(path, target_path).unwrap();

0 commit comments

Comments
 (0)