cobble_core/instance/remove.rs
1use tokio::fs::remove_dir_all;
2
3use crate::error::CobbleResult;
4use crate::Instance;
5
6impl Instance {
7 /// Removes the instance from disk.
8 ///
9 /// **Warning**: This will permanently delete the following files:
10 ///
11 /// - Resourcepacks
12 /// - Save games
13 /// - Screenshots
14 /// - Servers
15 /// - Shaderpacks
16 /// - Mods
17 ///
18 /// It basically deletes the whole .minecraft folder.
19 #[instrument(name = "remove_instance", level = "trace", skip_all, fields(name,))]
20 pub async fn remove(self) -> CobbleResult<()> {
21 remove_dir_all(self.instance_path()).await?;
22 Ok(())
23 }
24}