@@ -71,24 +71,32 @@ public void RunCommandLineWindow(NPath workingDirectory)
7171 if ( environment . IsWindows )
7272 {
7373 startInfo . FileName = "cmd" ;
74+ gitEnvironment . Configure ( startInfo , workingDirectory ) ;
7475 }
7576 else if ( environment . IsMac )
7677 {
7778 // we need to create a temp bash script to set up the environment properly, because
7879 // osx terminal app doesn't inherit the PATH env var and there's no way to pass it in
7980
8081 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)
8382 startInfo . FileName = "open" ;
8483 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)
8593 }
8694 else
8795 {
8896 startInfo . FileName = "sh" ;
97+ gitEnvironment . Configure ( startInfo , workingDirectory ) ;
8998 }
9099
91- gitEnvironment . Configure ( startInfo , workingDirectory ) ;
92100 Process . Start ( startInfo ) ;
93101 }
94102
0 commit comments