@@ -71,24 +71,32 @@ public void RunCommandLineWindow(NPath workingDirectory)
71
71
if ( environment . IsWindows )
72
72
{
73
73
startInfo . FileName = "cmd" ;
74
+ gitEnvironment . Configure ( startInfo , workingDirectory ) ;
74
75
}
75
76
else if ( environment . IsMac )
76
77
{
77
78
// we need to create a temp bash script to set up the environment properly, because
78
79
// osx terminal app doesn't inherit the PATH env var and there's no way to pass it in
79
80
80
81
var envVarFile = NPath . GetTempFilename ( ) ;
81
- environment . FileSystem . WriteAllLines ( envVarFile , new string [ ] { "cd $GHU_WORKINGDIR" , "PATH=$GHU_FULLPATH:$PATH /bin/bash" } ) ;
82
- Mono . Unix . Native . Syscall . chmod ( envVarFile , ( Mono . Unix . Native . FilePermissions ) 493 ) ; // -rwxr-xr-x mode (0755)
83
82
startInfo . FileName = "open" ;
84
83
startInfo . Arguments = $ "-a Terminal { envVarFile } ";
84
+ gitEnvironment . Configure ( startInfo , workingDirectory ) ;
85
+
86
+ var envVars = startInfo . EnvironmentVariables ;
87
+ var scriptContents = new [ ] {
88
+ $ "cd { envVars [ "GHU_WORKINGDIR" ] } ",
89
+ $ "PATH={ envVars [ "GHU_FULLPATH" ] } :$PATH /bin/bash"
90
+ } ;
91
+ environment . FileSystem . WriteAllLines ( envVarFile , scriptContents ) ;
92
+ Mono . Unix . Native . Syscall . chmod ( envVarFile , ( Mono . Unix . Native . FilePermissions ) 493 ) ; // -rwxr-xr-x mode (0755)
85
93
}
86
94
else
87
95
{
88
96
startInfo . FileName = "sh" ;
97
+ gitEnvironment . Configure ( startInfo , workingDirectory ) ;
89
98
}
90
99
91
- gitEnvironment . Configure ( startInfo , workingDirectory ) ;
92
100
Process . Start ( startInfo ) ;
93
101
}
94
102
0 commit comments