parent
51553b2eaf
commit
c9c7c05261
@ -1,17 +0,0 @@
|
||||
using Recyclarr.Cli.Console.Setup;
|
||||
using Spectre.Console.Cli;
|
||||
|
||||
namespace Recyclarr.Cli.Console.Interceptors;
|
||||
|
||||
public class GlobalTaskInterceptor(IOrderedEnumerable<IGlobalSetupTask> tasks) : ICommandInterceptor
|
||||
{
|
||||
public void Intercept(CommandContext context, CommandSettings settings)
|
||||
{
|
||||
tasks.ForEach(x => x.OnStart());
|
||||
}
|
||||
|
||||
public void InterceptResult(CommandContext context, CommandSettings settings, ref int result)
|
||||
{
|
||||
tasks.Reverse().ForEach(x => x.OnFinish());
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
using Recyclarr.Platform;
|
||||
using Spectre.Console.Cli;
|
||||
|
||||
namespace Recyclarr.Cli.Console.Interceptors;
|
||||
|
||||
public class ProgramInformationLogInterceptor(ILogger log, IAppPaths paths) : ICommandInterceptor
|
||||
{
|
||||
public void Intercept(CommandContext context, CommandSettings settings)
|
||||
{
|
||||
log.Debug("Recyclarr Version: {Version}", GitVersionInformation.InformationalVersion);
|
||||
log.Debug("App Data Dir: {AppData}", paths.AppDataDirectory);
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
namespace Recyclarr.Cli.Console.Setup;
|
||||
|
||||
public class GlobalSetupTaskExecutor(IOrderedEnumerable<IGlobalSetupTask> tasks)
|
||||
{
|
||||
public void OnStart()
|
||||
{
|
||||
tasks.ForEach(x => x.OnStart());
|
||||
}
|
||||
|
||||
public void OnFinish()
|
||||
{
|
||||
tasks.Reverse().ForEach(x => x.OnFinish());
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using Recyclarr.Platform;
|
||||
|
||||
namespace Recyclarr.Cli.Console.Setup;
|
||||
|
||||
public class ProgramInformationDisplayTask(ILogger log, IAppPaths paths) : IGlobalSetupTask
|
||||
{
|
||||
public void OnStart()
|
||||
{
|
||||
log.Debug("Recyclarr Version: {Version}", GitVersionInformation.InformationalVersion);
|
||||
log.Debug("App Data Dir: {AppData}", paths.AppDataDirectory);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue