feat(cli): show full expected path of frontendDist if not found (#9459)

* feat(cli): show full expected path of frontendDist
This commit is contained in:
Kornel 2024-04-15 08:18:46 +01:00 committed by GitHub
parent 32b213399f
commit 8f4b1050c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 2 deletions

View File

@ -0,0 +1,6 @@
---
"tauri-cli": patch
"@tauri-apps/cli": patch
---
Show full expected path of `frontendDist` when if can't be found.

View File

@ -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")) {