Skip to content

Commit 8f4b105

Browse files
authored
feat(cli): show full expected path of frontendDist if not found (#9459)
* feat(cli): show full expected path of frontendDist
1 parent 32b2133 commit 8f4b105

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-cli": patch
3+
"@tauri-apps/cli": patch
4+
---
5+
6+
Show full expected path of `frontendDist` when if can't be found.

tooling/cli/src/build.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,14 @@ pub fn setup(
175175

176176
if let Some(FrontendDist::Directory(web_asset_path)) = &config_.build.frontend_dist {
177177
if !web_asset_path.exists() {
178+
let absolute_path = web_asset_path
179+
.parent()
180+
.and_then(|p| p.canonicalize().ok())
181+
.map(|p| p.join(web_asset_path.file_name().unwrap()))
182+
.unwrap_or_else(|| std::env::current_dir().unwrap().join(web_asset_path));
178183
return Err(anyhow::anyhow!(
179-
"Unable to find your web assets, did you forget to build your web app? Your frontendDist is set to \"{:?}\".",
180-
web_asset_path
184+
"Unable to find your web assets, did you forget to build your web app? Your frontendDist is set to \"{}\" (which is `{}`).",
185+
web_asset_path.display(), absolute_path.display(),
181186
));
182187
}
183188
if web_asset_path.canonicalize()?.file_name() == Some(std::ffi::OsStr::new("src-tauri")) {

0 commit comments

Comments
 (0)