mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
23 lines
579 B
C#
23 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);
|
||
|
}
|
||
|
}
|
||
|
}
|