fix the assets head path (#2267)
This commit is contained in:
1 parent
a012fb57ab
commit
40b576894f
1 file changed
+8
-2
@@ -81,8 +81,14 @@ fn assets_head() -> Option<String> {
|
||||
target_os = "openbsd"
|
||||
))]
|
||||
{
|
||||
let head = crate::protocol::get_asset_root_or_default();
|
||||
let head = head.join("dist").join("__assets_head.html");
|
||||
let root = crate::protocol::get_asset_root_or_default();
|
||||
let assets_head_path = "__assets_head.html";
|
||||
let mut head = root.join(assets_head_path);
|
||||
// If we can't find it, add the dist directory and try again
|
||||
// When bundling we currently copy the whole dist directory to the output directory instead of the individual files because of a limitation of cargo bundle2
|
||||
if !head.exists() {
|
||||
head = root.join("dist").join(assets_head_path);
|
||||
}
|
||||
match std::fs::read_to_string(&head) {
|
||||
Ok(s) => Some(s),
|
||||
Err(err) => {
|
||||
|
||||
Reference in new issue
Block a user