diff --git a/ReCodeItCLI/Commands/AutoMatcher.cs b/ReCodeItCLI/Commands/AutoMatcher.cs index 40cc589..e192e95 100644 --- a/ReCodeItCLI/Commands/AutoMatcher.cs +++ b/ReCodeItCLI/Commands/AutoMatcher.cs @@ -1,4 +1,8 @@ -using CliFx; +// Uncomment this to have the application wait for a debugger to attach before running. +#define WAIT_FOR_DEBUGGER + +using System.Diagnostics; +using CliFx; using CliFx.Attributes; using CliFx.Infrastructure; using ReCodeItLib.Models; @@ -28,6 +32,14 @@ public class AutoMatchCommand : ICommand Logger.LogSync("Finding match..."); var remaps = new List(); + +#if WAIT_FOR_DEBUGGER + Logger.LogSync("Waiting for debugger..."); + while (!Debugger.IsAttached) + { + Thread.Sleep(100); + } +#endif if (!string.IsNullOrEmpty(MappingsPath)) { diff --git a/ReCodeItCLI/Commands/ReMap.cs b/ReCodeItCLI/Commands/ReMap.cs index f3e90c3..0fafbb9 100644 --- a/ReCodeItCLI/Commands/ReMap.cs +++ b/ReCodeItCLI/Commands/ReMap.cs @@ -1,4 +1,8 @@ -using CliFx; +// Uncomment this to have the application wait for a debugger to attach before running. +//#define WAIT_FOR_DEBUGGER + +using System.Diagnostics; +using CliFx; using CliFx.Attributes; using CliFx.Infrastructure; using ReCodeItLib.Utils; @@ -19,6 +23,14 @@ public class ReMap : ICommand public ValueTask ExecuteAsync(IConsole console) { +#if WAIT_FOR_DEBUGGER + Logger.LogSync("Waiting for debugger..."); + while (!Debugger.IsAttached) + { + Thread.Sleep(100); + } +#endif + DataProvider.Settings.MappingPath = MappingJsonPath; var remaps = DataProvider.LoadMappingFile(MappingJsonPath);