2024-02-05 23:08:37 -08:00
|
|
|
|
using System.Collections.Generic;
|
2021-04-29 06:22:17 -07:00
|
|
|
|
using System.Text;
|
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
|
namespace SourceGit.Commands
|
|
|
|
|
{
|
|
|
|
|
public class Clean : Command
|
|
|
|
|
{
|
|
|
|
|
public Clean(string repo)
|
|
|
|
|
{
|
2024-02-05 23:08:37 -08:00
|
|
|
|
WorkingDirectory = repo;
|
|
|
|
|
Context = repo;
|
2021-04-29 05:05:55 -07:00
|
|
|
|
Args = "clean -qfd";
|
|
|
|
|
}
|
2021-04-29 06:22:17 -07:00
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
|
public Clean(string repo, List<string> files)
|
|
|
|
|
{
|
2021-04-29 06:22:17 -07:00
|
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
|
|
builder.Append("clean -qfd --");
|
2024-03-17 18:37:06 -07:00
|
|
|
|
foreach (var f in files)
|
|
|
|
|
{
|
2021-04-29 06:22:17 -07:00
|
|
|
|
builder.Append(" \"");
|
|
|
|
|
builder.Append(f);
|
|
|
|
|
builder.Append("\"");
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-05 23:08:37 -08:00
|
|
|
|
WorkingDirectory = repo;
|
|
|
|
|
Context = repo;
|
2021-04-29 06:22:17 -07:00
|
|
|
|
Args = builder.ToString();
|
|
|
|
|
}
|
2021-04-29 05:05:55 -07:00
|
|
|
|
}
|
2024-03-31 01:54:29 -07:00
|
|
|
|
}
|