Browse Source

Merge pull request #75 from mhfan/for-pr

fix some non-sense code
YuKun Liu 2 years ago
parent
commit
3bac1ac1a7
2 changed files with 1 additions and 7 deletions
  1. 0 6
      src/builder.rs
  2. 1 1
      src/cli/serve/mod.rs

+ 0 - 6
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",

+ 1 - 1
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()?;
                 }