force dry run via start arg
This commit is contained in:
@@ -3,6 +3,13 @@ using sh.actions.package_cleanup.Service;
|
||||
|
||||
var builder = Host.CreateApplicationBuilder(args);
|
||||
|
||||
// Check for --dry-run argument
|
||||
var isDryRun = args.Contains("--dry-run");
|
||||
if (isDryRun)
|
||||
{
|
||||
Environment.SetEnvironmentVariable("DRY_RUN", "true");
|
||||
}
|
||||
|
||||
builder.Configuration
|
||||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
|
||||
.AddJsonFile("appsettings.local.json", optional: true, reloadOnChange: true)
|
||||
@@ -20,5 +27,4 @@ builder.Logging.AddConsole();
|
||||
builder.Logging.SetMinimumLevel(LogLevel.Debug);
|
||||
|
||||
var host = builder.Build();
|
||||
Console.WriteLine("STARTING");
|
||||
await host.RunAsync();
|
||||
|
||||
Reference in New Issue
Block a user