Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 1a78baf

Browse files
committed
Make sure we always delete temp directories
1 parent 5371f1e commit 1a78baf

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/GitHub.Api/Installer/OctorunInstaller.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public NPath SetupOctorunIfNeeded()
4444
var extractPath = unzipTask.RunWithReturn(true);
4545
if (unzipTask.Successful)
4646
path = MoveOctorun(extractPath.Combine("octorun"));
47+
tempZipExtractPath.DeleteIfExists();
4748
}
4849
return path;
4950
}

src/GitHub.Api/Tasks/DownloadTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ class DownloadTask : TaskBase<NPath>
3232
public DownloadTask(CancellationToken token,
3333
IFileSystem fileSystem,
3434
UriString url,
35-
NPath? targetDirectory = null,
35+
NPath targetDirectory,
3636
int retryCount = 0)
3737
: base(token)
3838
{
3939
this.fileSystem = fileSystem;
4040
RetryCount = retryCount;
4141
Url = url;
4242
Filename = url.Filename;
43-
TargetDirectory = targetDirectory ?? NPath.CreateTempDirectory("ghu");
43+
TargetDirectory = targetDirectory;
4444
this.Name = $"Download {Url}";
4545
}
4646

src/tests/IntegrationTests/Download/DownloadTaskTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ public void DownloadingFromNonExistingDomainThrows()
318318

319319
var fileSystem = NPath.FileSystem;
320320

321-
var downloadTask = new DownloadTask(TaskManager.Token, fileSystem, "http://ggggithub.com/robots.txt");
321+
var downloadTask = new DownloadTask(TaskManager.Token, fileSystem, "http://ggggithub.com/robots.txt", TestBasePath);
322322
var exceptionThrown = false;
323323

324324
var autoResetEvent = new AutoResetEvent(false);

0 commit comments

Comments
 (0)