mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-11-28 20:48:52 +03:00
fix(cli.rs): check if distDir exists after running beforeDevCommand
(#1586)
This commit is contained in:
parent
99307d02c3
commit
a670d3a457
5
.changes/cli-rs-dist-validation.md
Normal file
5
.changes/cli-rs-dist-validation.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"cli.rs": patch
|
||||
---
|
||||
|
||||
Check if distDir assets are built after running `beforeDevCommand`.
|
@ -64,14 +64,6 @@ impl Build {
|
||||
let config_guard = config.lock().unwrap();
|
||||
let config_ = config_guard.as_ref().unwrap();
|
||||
|
||||
let web_asset_path = PathBuf::from(&config_.build.dist_dir);
|
||||
if !web_asset_path.exists() {
|
||||
return Err(anyhow::anyhow!(
|
||||
"Unable to find your web assets, did you forget to build your web app? Your distDir is set to \"{:?}\".",
|
||||
web_asset_path
|
||||
));
|
||||
}
|
||||
|
||||
if let Some(before_build) = &config_.build.before_build_command {
|
||||
if !before_build.is_empty() {
|
||||
logger.log(format!("Running `{}`", before_build));
|
||||
@ -92,6 +84,14 @@ impl Build {
|
||||
}
|
||||
}
|
||||
|
||||
let web_asset_path = PathBuf::from(&config_.build.dist_dir);
|
||||
if !web_asset_path.exists() {
|
||||
return Err(anyhow::anyhow!(
|
||||
"Unable to find your web assets, did you forget to build your web app? Your distDir is set to \"{:?}\".",
|
||||
web_asset_path
|
||||
));
|
||||
}
|
||||
|
||||
rust::build_project(self.debug)?;
|
||||
|
||||
let app_settings = rust::AppSettings::new(&config_)?;
|
||||
|
Loading…
Reference in New Issue
Block a user