mirror of
https://github.com/chylex/Code-Statistics.git
synced 2025-07-26 13:59:07 +02:00
Delete downloaded archives from GitHub
This commit is contained in:
parent
51b4cbdf4b
commit
4e4d8eed1f
CodeStatistics/Input/Methods
@ -119,7 +119,7 @@ namespace CodeStatistics.Input.Methods{
|
||||
|
||||
dlRepoCancel = archive.ExtractAsync(path => {
|
||||
callbacks.OnReady(new FileSearch(new string[]{ path }));
|
||||
archive.Dispose();
|
||||
archive.DeleteAndDispose();
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -71,14 +71,19 @@ namespace CodeStatistics.Input.Methods{
|
||||
|
||||
Directory.CreateDirectory(Path.Combine(extractPath,dirName));
|
||||
|
||||
using(Stream stream = entry.CreateStream()){
|
||||
using(var fileStream = System.IO.File.Create(Path.Combine(extractPath,entry.Path))){
|
||||
stream.Seek(0,SeekOrigin.Begin);
|
||||
stream.CopyTo(fileStream);
|
||||
using(var sourceStream = entry.CreateStream()){
|
||||
using(var fileStream = new FileStream(Path.Combine(extractPath,entry.Path),FileMode.OpenOrCreate,FileAccess.Write,FileShare.None)){
|
||||
sourceStream.Seek(0,SeekOrigin.Begin);
|
||||
sourceStream.CopyTo(fileStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteAndDispose(){
|
||||
Dispose();
|
||||
System.IO.File.Delete(file);
|
||||
}
|
||||
|
||||
public void Dispose(){
|
||||
((IDisposable)inner).Dispose();
|
||||
if (cancelToken != null)cancelToken.Dispose();
|
||||
|
Loading…
Reference in New Issue
Block a user