From c2c4989483d797962c520aac744b5a49a0a23d11 Mon Sep 17 00:00:00 2001 From: MeiHui FAN Date: Mon, 24 Oct 2022 19:48:23 +0800 Subject: [PATCH 1/2] Why clean up the 'dist' directory when building for desktop? This can affect things like extra side generating css files. --- src/builder.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 4cc3ece3f..de59373c0 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -284,12 +284,6 @@ pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { } if output.status.success() { - // this code will clean the output dir. - // if using the serve, we will not clean the out_dir. - if config.out_dir.is_dir() && !is_serve { - remove_dir_all(&config.out_dir)?; - } - let release_type = match config.release { true => "release", false => "debug", From 029c0b23f4900fdd2b80e219f834eea4f805d3f2 Mon Sep 17 00:00:00 2001 From: MeiHui FAN Date: Mon, 24 Oct 2022 19:58:22 +0800 Subject: [PATCH 2/2] eliminate duplicate absolute path join --- src/cli/serve/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 6619da53d..d99842fc4 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -49,7 +49,7 @@ impl Serve { if cfg!(windows) { file.set_extension("exe"); } - Command::new(crate_config.out_dir.join(file).to_str().unwrap()) + Command::new(file.to_str().unwrap()) .stdout(Stdio::inherit()) .output()?; }