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

Commit 56a4662

Browse files
authored
Merge pull request #319 from github/fixes/git-installer
Fix to install git resources better
2 parents 0d1c28f + be09ad1 commit 56a4662

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/GitHub.Api/Installer/GitInstaller.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,16 @@ public Task<bool> SetupGitIfNeeded(NPath tempPath, IProgress<float> zipFileProgr
203203

204204
try
205205
{
206-
logger.Trace("Copying \"{0}\" to \"{1}\"", unzipPath, PackageDestinationDirectory);
206+
PackageDestinationDirectory.DeleteIfExists();
207+
PackageDestinationDirectory.EnsureParentDirectoryExists();
207208

208-
unzipPath.Copy(PackageDestinationDirectory);
209+
logger.Trace("Moving \"{0}\" to \"{1}\"", unzipPath, PackageDestinationDirectory);
210+
211+
unzipPath.Move(PackageDestinationDirectory);
209212
}
210213
catch (Exception ex)
211214
{
212-
logger.Error(ex, "Error CopyingArchive Source:\"{0}\" OutDir:\"{1}\"", tempPath, PackageDestinationDirectory);
215+
logger.Error(ex, "Error Moving \"{0}\" to \"{1}\"", tempPath, PackageDestinationDirectory);
213216
return TaskEx.FromResult(false);
214217
}
215218
unzipPath.DeleteIfExists();

0 commit comments

Comments
 (0)