Clean up temp directory after packaging mcworld

This commit is contained in:
louis-e
2025-12-04 16:52:07 +01:00
parent f1b37fbbb6
commit 562a3bca66

View File

@@ -1315,6 +1315,7 @@ mod bedrock_support {
self.write_chunks_to_db(world)?;
self.write_metadata(world, xzbbox, llbbox)?;
self.package_mcworld()?;
self.cleanup_temp_dir()?;
Ok(())
}
@@ -1829,6 +1830,14 @@ mod bedrock_support {
Ok(())
}
/// Clean up the temporary directory after packaging mcworld
fn cleanup_temp_dir(&self) -> Result<(), BedrockSaveError> {
if self.output_dir.exists() {
fs::remove_dir_all(&self.output_dir)?;
}
Ok(())
}
fn add_directory_to_zip(
&self,
writer: &mut ZipWriter<File>,