Skip to content

Commit

Permalink
feat(cli): show full expected path of frontendDist if not found (#9459
Browse files Browse the repository at this point in the history
)

* feat(cli): show full expected path of frontendDist
  • Loading branch information
kornelski committed Apr 15, 2024
1 parent 32b2133 commit 8f4b105
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changes/cli-frontend-dist-expected-path.md
@@ -0,0 +1,6 @@
---
"tauri-cli": patch
"@tauri-apps/cli": patch
---

Show full expected path of `frontendDist` when if can't be found.
9 changes: 7 additions & 2 deletions tooling/cli/src/build.rs
Expand Up @@ -175,9 +175,14 @@ pub fn setup(

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

0 comments on commit 8f4b105

Please sign in to comment.