Skip to content

Commit

Permalink
fix: zola panic if no static dir (#2608)
Browse files Browse the repository at this point in the history
  • Loading branch information
amtanq authored Aug 11, 2024
1 parent 5e67227 commit 0ce8936
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cmd/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use ws::{Message, Sender, WebSocket};
use errors::{anyhow, Context, Error, Result};
use site::sass::compile_sass;
use site::{Site, SITE_CONTENT};
use utils::fs::{clean_site_output_folder, copy_file};
use utils::fs::{clean_site_output_folder, copy_file, create_directory};

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

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

0 comments on commit 0ce8936

Please sign in to comment.