Skip to content

Commit 38cc1f5

Browse files
committed
fix: build issues with rust embed
1 parent a0ea564 commit 38cc1f5

File tree

6 files changed

+15
-281
lines changed

6 files changed

+15
-281
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ default: release
55
release: ui-build
66
make -C ./crates/http-server release
77

8+
run:
9+
make -C ./crates/http-server run
10+
811
ui-build:
912
make -C ./crates/file-explorer-ui release
1013

crates/file-explorer-ui/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ default:
66
dev:
77
trunk serve --config ./Trunk.toml
88

9+
dist:
10+
trunk build --config ./Trunk.toml
11+
912
fmt:
1013
@leptosfmt --version >/dev/null 2>&1 || (echo "Error: leptosfmt is required."; exit 1)
1114
leptosfmt ./src/**/*.rs

crates/file-explorer-ui/Trunk.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ watch = ["./src"]
99
ignore = []
1010

1111
[[proxy]]
12-
backend = "http://127.0.0.1:3000/api/v1"
12+
backend = "http://127.0.0.1:7878/api/v1"
1313
rewrite = "/api/v1"

crates/http-server/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ default:
55

66
release:
77
cargo b --release
8+
9+
dist:
10+
make -C ../file-explorer-ui dist
11+
12+
run: dist
13+
cargo r -- start

crates/http-server/src/handler/file_explorer/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use self::proto::BreadcrumbItem;
2222
use self::utils::{decode_uri, encode_uri, PERCENT_ENCODE_SET};
2323

2424
#[derive(Embed)]
25-
#[folder = "../file-explorer-ui/public/dist"]
25+
#[folder = "../file-explorer-ui/dist"]
2626
struct FileExplorerAssets;
2727

2828
pub struct FileExplorer {
@@ -208,7 +208,7 @@ impl FileExplorer {
208208
fn breadcrumbs_from_path(root_dir: &Path, path: &Path) -> Result<Vec<BreadcrumbItem>> {
209209
let root_dir_name = root_dir
210210
.components()
211-
.last()
211+
.next_back()
212212
.unwrap()
213213
.as_os_str()
214214
.to_str()

rustfmt.toml

Lines changed: 0 additions & 278 deletions
This file was deleted.

0 commit comments

Comments
 (0)