Skip to content

Commit 0ce8936

Browse files
authored
fix: zola panic if no static dir (#2608)
1 parent 5e67227 commit 0ce8936

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cmd/serve.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ use ws::{Message, Sender, WebSocket};
4848
use errors::{anyhow, Context, Error, Result};
4949
use site::sass::compile_sass;
5050
use site::{Site, SITE_CONTENT};
51-
use utils::fs::{clean_site_output_folder, copy_file};
51+
use utils::fs::{clean_site_output_folder, copy_file, create_directory};
5252

5353
use crate::fs_utils::{filter_events, ChangeKind, SimpleFileSystemEventKind};
5454
use crate::messages;
@@ -502,6 +502,7 @@ pub fn serve(
502502
let ws_port = site.live_reload;
503503
let ws_address = format!("{}:{}", interface, ws_port.unwrap());
504504
let output_path = site.output_path.clone();
505+
create_directory(&output_path)?;
505506

506507
// static_root needs to be canonicalized because we do the same for the http server.
507508
let static_root = std::fs::canonicalize(&output_path).unwrap();

0 commit comments

Comments
 (0)