@@ -184,7 +184,7 @@ func (s *Exec) Run(params *Params, args ...string) (rerr error) {
184184 }
185185 }
186186
187- _ , _ , err = osutils .ExecuteAndPipeStd (exeTarget , args [1 :], sortPaths ( osutils .EnvMapToSlice (env ) ))
187+ _ , _ , err = osutils .ExecuteAndPipeStd (exeTarget , args [1 :], osutils .EnvMapToSlice (env ))
188188 if eerr , ok := err .(* exec.ExitError ); ok {
189189 return errs .Silence (errs .WrapExitCode (eerr , eerr .ExitCode ()))
190190 }
@@ -195,46 +195,6 @@ func (s *Exec) Run(params *Params, args ...string) (rerr error) {
195195 return nil
196196}
197197
198- // sortPaths the env so our PATH environment variable is interpreted first
199- func sortPaths (env []string ) []string {
200- if runtime .GOOS != "windows" {
201- return env
202- }
203-
204- const (
205- windowsPathPrefix = "Path="
206- unixPathPrefix = "PATH="
207- )
208-
209- var windowsPathIndex , unixPathIndex = - 1 , - 1
210- for i , e := range env {
211- switch {
212- case strings .HasPrefix (e , windowsPathPrefix ):
213- windowsPathIndex = i
214- case strings .HasPrefix (e , unixPathPrefix ):
215- unixPathIndex = i
216- }
217- if windowsPathIndex != - 1 && unixPathIndex != - 1 {
218- break
219- }
220- }
221-
222- if windowsPathIndex == - 1 || unixPathIndex == - 1 {
223- return env
224- }
225-
226- // Ensure Unix PATH is after Windows PATH
227- if windowsPathIndex > unixPathIndex {
228- env [windowsPathIndex ], env [unixPathIndex ] = env [unixPathIndex ], env [windowsPathIndex ]
229- }
230-
231- for _ , e := range env {
232- fmt .Println (e )
233- }
234-
235- return env
236- }
237-
238198func projectFromRuntimeDir (cfg projectfile.ConfigGetter , runtimeDir string ) string {
239199 projects := projectfile .GetProjectMapping (cfg )
240200 for _ , paths := range projects {
0 commit comments