first commit
This commit is contained in:
22
Commands/CleanCommand.cs
Normal file
22
Commands/CleanCommand.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using HanaToolbox.Cli;
|
||||
using HanaToolbox.Config;
|
||||
using HanaToolbox.Logging;
|
||||
using HanaToolbox.Services;
|
||||
|
||||
namespace HanaToolbox.Commands;
|
||||
|
||||
public static class CleanCommand
|
||||
{
|
||||
public static async Task<int> RunAsync(CliArgs cli)
|
||||
{
|
||||
var log = new AppLogger(cli.Verbose);
|
||||
try
|
||||
{
|
||||
var config = ConfigService.Load();
|
||||
log.Step("Starting cleanup...");
|
||||
await new CleanerService(log).RunAsync(config.Cleaner);
|
||||
return 0;
|
||||
}
|
||||
catch (Exception ex) { log.Error(ex.Message); return 1; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user