aboutsummaryrefslogtreecommitdiff
path: root/src/Commands/CleanCommand.cs
blob: 6570b3182e9e00962ba83dc46c86ded184ac007f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Threading.Tasks;

using Typin.Console;
using Typin.Attributes;

using VNLib.Tools.Build.Executor.Model;
using VNLib.Tools.Build.Executor.Constants;

namespace VNLib.Tools.Build.Executor.Commands
{

    [Command("clean", Description = "Cleans the build pipeline")]
    public sealed class CleanCommand(BuildPipeline pipeline, ConfigManager cfg) : BaseCommand(pipeline, cfg)
    {
        public override async ValueTask ExecStepsAsync(IConsole console)
        {
            console.Output.WriteLine("Begining clean step");

            await pipeline.DoStepCleanAsync();

            //Cleanup the sum dir and scratch dir
            Config.Index.SumDir.Delete(true);
            Config.Index.ScratchDir.Delete(true);

            console.WithForegroundColor(ConsoleColor.Green, o => o.Output.WriteLine("Pipeline cleaned"));
        }

        public override IFeedManager[] Feeds => [];
    }
}