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

Commit 08a7dbd

Browse files
authored
Merge pull request #292 from github-for-unity/fixes/git-path-find-button
Adding fixes to the "Find Install" button
2 parents 6235515 + 2c2e422 commit 08a7dbd

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/SettingsView.cs

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,16 +478,37 @@ private void OnInstallPathGUI()
478478
// Find button - for attempting to locate a new install
479479
if (GUILayout.Button(GitInstallFindButton, GUILayout.ExpandWidth(false)))
480480
{
481-
var task = new ProcessTask<NPath>(Manager.CancellationToken, new FirstLineIsPathOutputProcessor())
481+
GUI.FocusControl(null);
482+
isBusy = true;
483+
484+
new ProcessTask<NPath>(Manager.CancellationToken, new FirstLineIsPathOutputProcessor())
482485
.Configure(Manager.ProcessManager, Environment.IsWindows ? "where" : "which", "git")
483486
.FinallyInUI((success, ex, path) =>
484487
{
485-
if (success && !string.IsNullOrEmpty(path))
488+
if (success)
489+
{
490+
Logger.Trace("FindGit Path:{0}", path);
491+
}
492+
else
486493
{
494+
if (ex != null)
495+
{
496+
Logger.Error(ex, "FindGit Error Path:{0}", path);
497+
}
498+
else
499+
{
500+
Logger.Error("FindGit Failed Path:{0}", path);
501+
}
502+
}
503+
504+
if (success)
505+
{
506+
Manager.SystemSettings.Set(Constants.GitInstallPathKey, path);
487507
Environment.GitExecutablePath = path;
488-
GUIUtility.keyboardControl = GUIUtility.hotControl = 0;
489508
}
490-
});
509+
510+
isBusy = false;
511+
}).Start();
491512
}
492513
}
493514
GUILayout.EndHorizontal();

0 commit comments

Comments
 (0)