From c80c69707cf77c529a3b8e82985db4681746f8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Tue, 15 Oct 2024 12:40:04 +0100 Subject: [PATCH] Make sure tmpdir is deleted when running devenv test We didn't notice this bug because it was immediately deleted and then created by self.assemble() --- devenv/src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/devenv/src/main.rs b/devenv/src/main.rs index a20c1ca40..259b89559 100644 --- a/devenv/src/main.rs +++ b/devenv/src/main.rs @@ -40,7 +40,8 @@ async fn main() -> Result<()> { ..Default::default() }; - if let Commands::Test { + // we let Drop delete the dir after all commands have ran + let _tmpdir = if let Commands::Test { dont_override_dotfile, } = cli.command { @@ -54,7 +55,10 @@ async fn main() -> Result<()> { )); options.devenv_dotfile = Some(tmpdir.path().to_path_buf()); } - } + Some(tmpdir) + } else { + None + }; let mut devenv = Devenv::new(options).await;