mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
feature<Achive>: add git archive
to commit's context menu
This commit is contained in:
parent
93835b48bc
commit
3f55d66e01
7 changed files with 182 additions and 2 deletions
22
src/Commands/Archive.cs
Normal file
22
src/Commands/Archive.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue