sourcegit/src/Commands/Archive.cs

22 lines
579 B
C#

using System;
namespace SourceGit.Commands {
/// <summary>
/// 存档命令
/// </summary>
public class Archive : Command {
private Action<string> handler;
public Archive(string repo, string revision, string to, Action<string> onProgress) {
Cwd = repo;
Args = $"archive --format=zip --verbose --output=\"{to}\" {revision}";
TraitErrorAsOutput = true;
handler = onProgress;
}
public override void OnReadline(string line) {
handler?.Invoke(line);
}
}
}