From 7f5da1e09c9a09427453457c67197fd00cfb8329 Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Sun, 9 Apr 2023 09:59:06 +0200 Subject: [PATCH] fix(dtmm): Skip mods folder in dtkit reset Fixes #107. --- crates/dtmm/src/controller/game.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/dtmm/src/controller/game.rs b/crates/dtmm/src/controller/game.rs index f6d92f0..d83d361 100644 --- a/crates/dtmm/src/controller/game.rs +++ b/crates/dtmm/src/controller/game.rs @@ -715,7 +715,11 @@ async fn reset_dtkit_patch(state: ActionState) -> Result<()> { } } - for path in [state.game_dir.join("mods"), state.game_dir.join("tools")] { + // We deliberately skip the `mods/` directory here. + // Many modders did their development right in there, and as people are prone to not read + // error messages and guides in full, there is bound to be someone who would have + // deleted all their source code if this removed the `mods/` folder. + for path in [state.game_dir.join("tools")] { match fs::remove_dir_all(&path).await { Ok(_) => tracing::trace!("Removed directory '{}'", path.display()), Err(err) if err.kind() != io::ErrorKind::NotFound => {