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

Commit 93a1db6

Browse files
Merge pull request #925 from github-for-unity/fixes/cannot-move-octorun
Changing how zip extracted resources are moved to their destination
2 parents e2f8c62 + abcd6c9 commit 93a1db6

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

src/GitHub.Api/Installer/GitInstaller.cs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -301,15 +301,18 @@ private GitInstallationState ExtractGit(GitInstallationState state)
301301
return true;
302302
});
303303
unzipTask.Progress(p => Progress.UpdateProgress(40 + (long)(20 * p.Percentage), 100, unzipTask.Message));
304-
var path = unzipTask.RunSynchronously();
304+
var source = unzipTask.RunSynchronously();
305305
var target = state.GitInstallationPath;
306306
if (unzipTask.Successful)
307307
{
308-
var source = path;
309-
target.DeleteIfExists();
310-
target.EnsureParentDirectoryExists();
311-
source.Move(target);
308+
Logger.Trace("Moving Git source:{0} target:{1}", source.ToString(), target.ToString());
309+
310+
target.DeleteContents();
311+
source.MoveFiles(target, true);
312+
source.Parent.Delete();
313+
312314
state.GitIsValid = true;
315+
313316
state.IsCustomGitPath = state.GitExecutablePath != installDetails.GitExecutablePath;
314317
}
315318
}
@@ -326,14 +329,16 @@ private GitInstallationState ExtractGit(GitInstallationState state)
326329
return true;
327330
});
328331
unzipTask.Progress(p => Progress.UpdateProgress(60 + (long)(20 * p.Percentage), 100, unzipTask.Message));
329-
var path = unzipTask.RunSynchronously();
332+
var source = unzipTask.RunSynchronously();
330333
var target = state.GitLfsInstallationPath;
331334
if (unzipTask.Successful)
332335
{
333-
var source = path;
334-
target.DeleteIfExists();
335-
target.EnsureParentDirectoryExists();
336-
source.Move(target);
336+
Logger.Trace("Moving GitLFS source:{0} target:{1}", source.ToString(), target.ToString());
337+
338+
target.DeleteContents();
339+
source.MoveFiles(target, true);
340+
source.Parent.Delete();
341+
337342
state.GitLfsIsValid = true;
338343
}
339344
}

src/GitHub.Api/Installer/OctorunInstaller.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,13 @@ private NPath GrabZipFromResources()
5252
private NPath MoveOctorun(NPath fromPath)
5353
{
5454
var toPath = installDetails.InstallationPath;
55-
toPath.DeleteIfExists();
56-
toPath.EnsureParentDirectoryExists();
57-
fromPath.Move(toPath);
55+
56+
Logger.Trace("MoveOctorun fromPath: {0} toPath:{1}", fromPath.ToString(), toPath.ToString());
57+
58+
toPath.DeleteContents();
59+
fromPath.MoveFiles(toPath, true);
5860
fromPath.Parent.Delete();
61+
5962
return installDetails.ExecutablePath;
6063
}
6164

0 commit comments

Comments
 (0)