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

Commit f34016b

Browse files
Fixing the load of the terminal and logging default system path
1 parent 240dc81 commit f34016b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/GitHub.Api/OutputProcessors/ProcessManager.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void RunCommandLineWindow(NPath workingDirectory)
8787
if (environment.IsWindows)
8888
{
8989
startInfo.FileName = "cmd";
90-
gitEnvironment.Configure(startInfo, workingDirectory);
90+
gitEnvironment.Configure(startInfo, workingDirectory, environment.IsCustomGitExecutable);
9191
}
9292
else if (environment.IsMac)
9393
{
@@ -97,7 +97,7 @@ public void RunCommandLineWindow(NPath workingDirectory)
9797
var envVarFile = NPath.GetTempFilename();
9898
startInfo.FileName = "open";
9999
startInfo.Arguments = $"-a Terminal {envVarFile}";
100-
gitEnvironment.Configure(startInfo, workingDirectory);
100+
gitEnvironment.Configure(startInfo, workingDirectory, environment.IsCustomGitExecutable);
101101

102102
var envVars = startInfo.EnvironmentVariables;
103103
var scriptContents = new List<string> {
@@ -107,14 +107,17 @@ public void RunCommandLineWindow(NPath workingDirectory)
107107
if (!environment.IsCustomGitExecutable) {
108108
scriptContents.Add($"PATH=\"{envVars["GHU_FULLPATH"]}\" /bin/bash");
109109
}
110+
else {
111+
scriptContents.Add($"/bin/bash");
112+
}
110113

111114
environment.FileSystem.WriteAllLines(envVarFile, scriptContents.ToArray());
112115
Mono.Unix.Native.Syscall.chmod(envVarFile, (Mono.Unix.Native.FilePermissions)493); // -rwxr-xr-x mode (0755)
113116
}
114117
else
115118
{
116119
startInfo.FileName = "sh";
117-
gitEnvironment.Configure(startInfo, workingDirectory);
120+
gitEnvironment.Configure(startInfo, workingDirectory, environment.IsCustomGitExecutable);
118121
}
119122

120123
Process.Start(startInfo);

src/GitHub.Api/Platform/ProcessEnvironment.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public void Configure(ProcessStartInfo psi, NPath workingDirectory, bool dontSet
2222
psi.EnvironmentVariables["TMP"] = psi.EnvironmentVariables["TEMP"] = NPath.SystemTemp;
2323
psi.EnvironmentVariables["GHU_WORKINGDIR"] = workingDirectory;
2424

25+
26+
Logger.Trace("Default System PATH:{0}", Environment.GetEnvironmentVariable("PATH"));
2527
Logger.Trace("Configure DontSetupGit:{0}", dontSetupGit);
2628

2729
// if we don't know where git is, then there's nothing else to configure

0 commit comments

Comments
 (0)