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

Commit 1e02102

Browse files
committed
Simplify getting the environment path initially
1 parent 1a514a7 commit 1e02102

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/GitHub.Api/Application/ApplicationManagerBase.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,25 @@ public void Run(bool firstRun)
5353
{
5454
Logger.Trace("Run - CurrentDirectory {0}", NPath.CurrentDirectory);
5555

56-
ITask<string> getMacEnvironmentPathTask;
56+
ITask<string> setExistingEnvironmentPath;
5757
if (Environment.IsMac)
5858
{
59-
getMacEnvironmentPathTask = new SimpleProcessTask(CancellationToken, "bash".ToNPath(), "-c \"/usr/libexec/path_helper\"")
60-
.Configure(ProcessManager)
59+
setExistingEnvironmentPath = new SimpleProcessTask(CancellationToken, "bash".ToNPath(), "-c \"/usr/libexec/path_helper\"")
60+
.Configure(ProcessManager, dontSetupGit: true)
6161
.Then((success, path) => success ? path.Split(new[] { "\"" }, StringSplitOptions.None)[1] : null);
6262
}
6363
else
6464
{
65-
getMacEnvironmentPathTask = new FuncTask<string>(CancellationToken, () => null);
65+
setExistingEnvironmentPath = new FuncTask<string>(CancellationToken, () => null);
6666
}
6767

68-
var setMacEnvironmentPathTask = getMacEnvironmentPathTask.Then((_, path) => {
68+
setExistingEnvironmentPath.OnEnd += (t, path, success, ex) => {
6969
if (path != null)
7070
{
71-
Logger.Trace("Mac Environment Path Original:{0} Updated:{1}", Environment.Path, path);
71+
Logger.Trace("Existing Environment Path Original:{0} Updated:{1}", Environment.Path, path);
7272
Environment.Path = path;
7373
}
74-
});
74+
};
7575

7676
var initEnvironmentTask = new ActionTask<NPath>(CancellationToken,
7777
(_, path) => InitializeEnvironment(path))
@@ -80,7 +80,7 @@ public void Run(bool firstRun)
8080
isBusy = true;
8181

8282
var octorunInstaller = new OctorunInstaller(Environment, TaskManager);
83-
var setupTask = setMacEnvironmentPathTask.Then(octorunInstaller.SetupOctorunIfNeeded());
83+
var setupTask = setExistingEnvironmentPath.Then(octorunInstaller.SetupOctorunIfNeeded());
8484

8585
var initializeGitTask = new FuncTask<NPath>(CancellationToken, () =>
8686
{

0 commit comments

Comments
 (0)