From af8eb338425daeffaeea3543e0d2c9c8eec06468 Mon Sep 17 00:00:00 2001 From: huntc Date: Fri, 11 Feb 2022 16:24:29 +1100 Subject: [PATCH] Do not remove the pkg directory A recent commit ensured that the pkg directory was removed as the first step of creating it. Unfortunately, this causes a problem for tools such as webpack when watching the pkg directory. In the case of webpack, it is unable to recover its watching and so any watch server must be restarted, consuming the developer's time. --- src/command/utils.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/command/utils.rs b/src/command/utils.rs index 7c6ec0c..4a735e2 100644 --- a/src/command/utils.rs +++ b/src/command/utils.rs @@ -37,7 +37,6 @@ fn find_manifest_from_cwd() -> Result { /// Construct our `pkg` directory in the crate. pub fn create_pkg_dir(out_dir: &Path) -> Result<(), failure::Error> { - let _ = fs::remove_dir_all(&out_dir); // Clean up any existing directory and ignore errors fs::create_dir_all(&out_dir)?; fs::write(out_dir.join(".gitignore"), "*")?; Ok(())