Skip to content

Commit

Permalink
Make sure tmpdir is deleted when running devenv test
Browse files Browse the repository at this point in the history
We didn't notice this bug because it was immediately deleted and then
created by self.assemble()
  • Loading branch information
domenkozar committed Oct 15, 2024
1 parent ef61728 commit c80c697
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions devenv/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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;

Expand Down

0 comments on commit c80c697

Please sign in to comment.