mirror of
https://github.com/nsnail/dot.git
synced 2025-06-19 22:08:16 +08:00
<clean>
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
using System.Collections.Concurrent;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
@ -7,7 +9,7 @@ namespace Dot.Git;
|
||||
|
||||
[Description(nameof(Str.GitTool))]
|
||||
[Localization(typeof(Str))]
|
||||
public class Main : ToolBase<Option>
|
||||
internal class Main : ToolBase<Option>
|
||||
{
|
||||
private Encoding _gitOutputEnc; //git command rsp 编码
|
||||
private ConcurrentDictionary<string, StringBuilder> _repoRsp; //仓库信息容器
|
||||
@ -43,7 +45,7 @@ public class Main : ToolBase<Option>
|
||||
p.ErrorDataReceived += ExecRspReceived;
|
||||
p.BeginOutputReadLine();
|
||||
p.BeginErrorReadLine();
|
||||
await p.WaitForExitAsync();
|
||||
await p.WaitForExitAsync(CancellationToken.None);
|
||||
|
||||
if (p.ExitCode == 0) {
|
||||
payload.Value.State.Status(TaskStatusColumn.Statues.Succeed);
|
||||
|
@ -1,6 +1,9 @@
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Dot.Git;
|
||||
|
||||
public class Option : OptionBase
|
||||
internal class Option : OptionBase
|
||||
{
|
||||
[CommandOption("-a|--args")]
|
||||
[Description(nameof(Str.GitArgs))]
|
||||
|
@ -1,12 +1,7 @@
|
||||
namespace Dot.Git;
|
||||
|
||||
public static class ProgressTaskStateExtensions
|
||||
internal static class ProgressTaskStateExtensions
|
||||
{
|
||||
public static TaskStatusColumn.Statues Status(this ProgressTaskState me)
|
||||
{
|
||||
return me.Get<TaskStatusColumn.Statues>(nameof(TaskStatusColumn));
|
||||
}
|
||||
|
||||
public static void Status(this ProgressTaskState me, TaskStatusColumn.Statues value)
|
||||
{
|
||||
me.Update<TaskStatusColumn.Statues>(nameof(TaskStatusColumn), _ => value);
|
||||
|
@ -1,13 +1,17 @@
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global
|
||||
|
||||
using NSExt.Extensions;
|
||||
using Spectre.Console.Rendering;
|
||||
|
||||
namespace Dot.Git;
|
||||
|
||||
public class TaskStatusColumn : ProgressColumn
|
||||
internal class TaskStatusColumn : ProgressColumn
|
||||
{
|
||||
public enum Statues : byte
|
||||
{
|
||||
[Description($"[gray]{nameof(Ready)}[/]")]
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
Ready
|
||||
|
||||
, [Description($"[yellow]{nameof(Executing)}[/]")]
|
||||
|
Reference in New Issue
Block a user