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

Commit f27a308

Browse files
committed
Fix running git installer if octorun also needs installing
1 parent fbcc3a8 commit f27a308

File tree

8 files changed

+17
-132
lines changed

8 files changed

+17
-132
lines changed

src/GitHub.Api/Application/ApplicationManagerBase.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,7 @@ public void Run(bool firstRun)
6161
isBusy = true;
6262

6363
var octorunInstaller = new OctorunInstaller(Environment, TaskManager);
64-
var setupTask = octorunInstaller
65-
.SetupOctorunIfNeeded()
66-
.Then((s, octorunPath) =>
67-
{
68-
Environment.OctorunScriptPath = octorunPath;
69-
});
64+
var setupTask = octorunInstaller.SetupOctorunIfNeeded();
7065

7166
var initializeGitTask = new FuncTask<NPath>(CancellationToken, () =>
7267
{
@@ -78,6 +73,15 @@ public void Run(bool firstRun)
7873
}
7974
return NPath.Default;
8075
});
76+
var setOctorunEnvironmentTask = new ActionTask<NPath>(CancellationToken, (s, octorunPath) =>
77+
{
78+
Environment.OctorunScriptPath = octorunPath;
79+
});
80+
81+
setupTask.OnEnd += (t, path, _, __) =>
82+
{
83+
t.GetEndOfChain().Then(setOctorunEnvironmentTask).Then(initializeGitTask);
84+
};
8185

8286
initializeGitTask.OnEnd += (t, path, _, __) =>
8387
{
@@ -101,7 +105,7 @@ public void Run(bool firstRun)
101105
t.Then(task, taskIsTopOfChain: true);
102106
};
103107

104-
setupTask.Then(initializeGitTask).Start();
108+
setupTask.Start();
105109
}
106110

107111
public ITask InitializeRepository()

src/GitHub.Api/GitHub.Api.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@
135135
<Compile Include="Git\GitStatusEntry.cs" />
136136
<Compile Include="Git\IGitObjectFactory.cs" />
137137
<Compile Include="Git\Tasks\GitRevertTask.cs" />
138-
<Compile Include="IO\FileSystemHelpers.cs" />
139138
<Compile Include="Application\IApplicationManager.cs" />
140139
<Compile Include="Tasks\ActionTask.cs" />
141140
<Compile Include="Tasks\BaseOutputProcessor.cs" />

src/GitHub.Api/IO/FileSystemHelpers.cs

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/GitHub.Api/Installer/GitInstaller.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ private FuncTask<NPath> ExtractPortableGit(GitInstallationState state)
174174
source.Move(target);
175175
state.GitExists = installDetails.GitExecutablePath.FileExists();
176176
state.GitIsValid = s;
177-
return path;
177+
return target;
178178
});
179179
task = unzipTask;
180180
}
@@ -197,15 +197,15 @@ private FuncTask<NPath> ExtractPortableGit(GitInstallationState state)
197197
source.Move(target);
198198
state.GitExists = target.FileExists();
199199
state.GitIsValid = s;
200-
return path;
200+
return target;
201201
});
202202
task = task?.Then(unzipTask) ?? unzipTask;
203203
}
204204

205205
return task.Finally(new FuncTask<NPath>(cancellationToken, (success) =>
206206
{
207207
tempZipExtractPath.DeleteIfExists();
208-
return installDetails.GitInstallationPath;
208+
return installDetails.GitExecutablePath;
209209
}));
210210
}
211211

src/tests/IntegrationTests/Auth/LoginTests.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/tests/IntegrationTests/IntegrationTests.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
<Reference Include="System.Xml" />
6969
</ItemGroup>
7070
<ItemGroup>
71-
<Compile Include="Auth\LoginTests.cs" />
7271
<Compile Include="Download\BaseTestWithHttpServer.cs" />
7372
<Compile Include="Download\DownloadTaskTests.cs" />
7473
<Compile Include="Events\RepositoryManagerTests.cs" />
@@ -141,6 +140,9 @@
141140
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
142141
</None>
143142
</ItemGroup>
143+
<ItemGroup>
144+
<Folder Include="Auth\" />
145+
</ItemGroup>
144146
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
145147
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
146148
Other similar extension points exist, see Microsoft.Common.targets.

src/tests/UnitTests/IO/FileSystemHelperTests.cs

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/tests/UnitTests/UnitTests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
<Compile Include="IO\MacBasedGitEnvironmentTests.cs" />
9393
<Compile Include="IO\LinuxBasedGitEnvironmentTests.cs" />
9494
<Compile Include="IO\WindowsGitEnvironmentTests.cs" />
95-
<Compile Include="IO\FileSystemHelperTests.cs" />
9695
<Compile Include="Primitives\UriStringTests.cs" />
9796
<Compile Include="ProcessManagerExtensions.cs" />
9897
<Compile Include="SetUpFixture.cs" />

0 commit comments

Comments
 (0)