Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
Unity
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Shane Veasy
Unity
Commits
3bf1eaf9
Commit
3bf1eaf9
authored
7 years ago
by
Andreia Gaita
Browse files
Options
Downloads
Patches
Plain Diff
Fix the command line environment on mac
parent
8310c7eb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/GitHub.Api/OutputProcessors/ProcessManager.cs
+6
-1
6 additions, 1 deletion
src/GitHub.Api/OutputProcessors/ProcessManager.cs
src/GitHub.Api/Platform/ProcessEnvironment.cs
+5
-6
5 additions, 6 deletions
src/GitHub.Api/Platform/ProcessEnvironment.cs
with
11 additions
and
7 deletions
src/GitHub.Api/OutputProcessors/ProcessManager.cs
+
6
−
1
View file @
3bf1eaf9
...
...
@@ -74,8 +74,13 @@ namespace GitHub.Unity
}
else
if
(
environment
.
IsMac
)
{
// we need to create a temp bash script to set up the environment properly, because
// osx terminal app doesn't inherit the PATH env var and there's no way to pass it in
var
envVarFile
=
environment
.
FileSystem
.
GetRandomFileName
();
environment
.
FileSystem
.
WriteAllLines
(
envVarFile
,
new
string
[]
{
"cd $GHU_WORKINGDIR"
,
"PATH=$GHU_FULLPATH:$PATH /bin/bash"
});
Mono
.
Unix
.
Native
.
Syscall
.
chmod
(
envVarFile
,
(
Mono
.
Unix
.
Native
.
FilePermissions
)
493
);
// -rwxr-xr-x mode (0755)
startInfo
.
FileName
=
"open"
;
startInfo
.
Arguments
=
$"-a Terminal
{
workingDirectory
}
"
;
startInfo
.
Arguments
=
$"-a Terminal
{
envVarFile
}
"
;
}
else
{
...
...
This diff is collapsed.
Click to expand it.
src/GitHub.Api/Platform/ProcessEnvironment.cs
+
5
−
6
View file @
3bf1eaf9
...
...
@@ -54,6 +54,7 @@ namespace GitHub.Unity
var
gitPathRoot
=
Environment
.
GitInstallPath
;
var
gitLfsPath
=
Environment
.
GitInstallPath
;
var
gitExecutableDir
=
Environment
.
GitExecutablePath
.
Parent
;
// original path to git (might be different from install path if it's a symlink)
// Paths to developer tools such as msbuild.exe
//var developerPaths = StringExtensions.JoinForAppending(";", developerEnvironment.GetPaths());
...
...
@@ -78,19 +79,17 @@ namespace GitHub.Unity
if
(
Environment
.
IsWindows
)
{
var
userPath
=
@"C:\windows\system32;C:\windows"
;
path
=
String
.
Format
(
CultureInfo
.
InvariantCulture
,
@"{0}\cmd;{0}\usr\bin;{1};{2};{0}\usr\share\git-tfs;{3};{4}{5}"
,
gitPathRoot
,
execPath
,
binPath
,
gitLfsPath
,
userPath
,
developerPaths
);
path
=
$"
{
gitPathRoot
}
\\cmd;
{
gitPathRoot
}
\\usr\\bin;
{
execPath
}
;
{
binPath
}
;
{
gitLfsPath
}
;
{
userPath
}{
developerPaths
}
"
;
}
else
{
var
userPath
=
Environment
.
Path
;
path
=
String
.
Format
(
CultureInfo
.
InvariantCulture
,
@"{0}:{1}:{2}:{3}{4}"
,
binPath
,
execPath
,
gitLfsPath
,
userPath
,
developerPaths
);
path
=
$"
{
gitExecutableDir
}
:
{
binPath
}
:
{
execPath
}
:
{
gitLfsPath
}
:
{
Environment
.
Path
}
:
{
developerPaths
}
"
;
}
psi
.
EnvironmentVariables
[
"GIT_EXEC_PATH"
]
=
execPath
.
ToString
();
psi
.
EnvironmentVariables
[
"PATH"
]
=
path
;
psi
.
EnvironmentVariables
[
"GHU_FULLPATH"
]
=
path
;
psi
.
EnvironmentVariables
[
"GHU_WORKINGDIR"
]
=
workingDirectory
;
psi
.
EnvironmentVariables
[
"PLINK_PROTOCOL"
]
=
"ssh"
;
psi
.
EnvironmentVariables
[
"TERM"
]
=
"msys"
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment