From 3ab1c055471f1c0cdc41c8af17768982b6694df4 Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Thu, 29 Aug 2024 19:35:27 -0400 Subject: [PATCH] Clear `_alreadyGivenNames` on each run, Create mapping file if it doesn't exist instead of throwing an exception --- RecodeItLib/Remapper/ReCodeItRemapper.cs | 2 ++ RecodeItLib/Utils/DataProvider.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/RecodeItLib/Remapper/ReCodeItRemapper.cs b/RecodeItLib/Remapper/ReCodeItRemapper.cs index a10f77b..6e16eb3 100644 --- a/RecodeItLib/Remapper/ReCodeItRemapper.cs +++ b/RecodeItLib/Remapper/ReCodeItRemapper.cs @@ -43,6 +43,8 @@ public class ReCodeItRemapper { _remaps = []; _remaps = remapModels; + _alreadyGivenNames = []; + Module = DataProvider.LoadModule(assemblyPath); OutPath = outPath; diff --git a/RecodeItLib/Utils/DataProvider.cs b/RecodeItLib/Utils/DataProvider.cs index 91c4159..18f3f61 100644 --- a/RecodeItLib/Utils/DataProvider.cs +++ b/RecodeItLib/Utils/DataProvider.cs @@ -97,7 +97,7 @@ public static class DataProvider { if (!File.Exists(path)) { - throw new FileNotFoundException($"path `{path}` does not exist..."); + File.Create(path).Close(); } JsonSerializerSettings settings = new()