mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-09-11 07:55:34 +03:00
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:
parent
32b213399f
commit
8f4b1050c4
6
.changes/cli-frontend-dist-expected-path.md
Normal file
6
.changes/cli-frontend-dist-expected-path.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"tauri-cli": patch
|
||||||
|
"@tauri-apps/cli": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Show full expected path of `frontendDist` when if can't be found.
|
@ -175,9 +175,14 @@ pub fn setup(
|
|||||||
|
|
||||||
if let Some(FrontendDist::Directory(web_asset_path)) = &config_.build.frontend_dist {
|
if let Some(FrontendDist::Directory(web_asset_path)) = &config_.build.frontend_dist {
|
||||||
if !web_asset_path.exists() {
|
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!(
|
return Err(anyhow::anyhow!(
|
||||||
"Unable to find your web assets, did you forget to build your web app? Your frontendDist is set to \"{:?}\".",
|
"Unable to find your web assets, did you forget to build your web app? Your frontendDist is set to \"{}\" (which is `{}`).",
|
||||||
web_asset_path
|
web_asset_path.display(), absolute_path.display(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
if web_asset_path.canonicalize()?.file_name() == Some(std::ffi::OsStr::new("src-tauri")) {
|
if web_asset_path.canonicalize()?.file_name() == Some(std::ffi::OsStr::new("src-tauri")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user