mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
22 lines
579 B
C#
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);
|
|
}
|
|
}
|
|
}
|