mirror of
https://github.com/sp-tarkov/assembly-tool.git
synced 2025-02-12 17:10:45 -05:00
Add ability to wait for a debugger to attach before executing. Uses preprocessor #define WAIT_FOR_DEBUGGER
This commit is contained in:
parent
1d3aedd7ab
commit
7ff1591674
@ -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;
|
||||
@ -29,6 +33,14 @@ public class AutoMatchCommand : ICommand
|
||||
|
||||
var remaps = new List<RemapModel>();
|
||||
|
||||
#if WAIT_FOR_DEBUGGER
|
||||
Logger.LogSync("Waiting for debugger...");
|
||||
while (!Debugger.IsAttached)
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!string.IsNullOrEmpty(MappingsPath))
|
||||
{
|
||||
Logger.LogSync("Loaded mapping file", ConsoleColor.Green);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user