executor_linux: Remove unreachable PATH= code (#9778)

This has to have been unused because the HasPrefix operation is
backwards, meaning a Command.Env that includes PATH= never would have
worked; the default path was always used.
This commit is contained in:
Kris Hicks
2021-01-15 11:19:09 -08:00
committed by GitHub
parent 182aa4a459
commit bcd4752fc9

View File

@@ -833,13 +833,7 @@ func lookupTaskBin(command *ExecCommand) (string, error) {
return "", fmt.Errorf("file %s not found under path %s", bin, taskDir)
}
// Find the PATH
path := "/usr/local/bin:/usr/bin:/bin"
for _, e := range command.Env {
if strings.HasPrefix("PATH=", e) {
path = e[5:]
}
}
return lookPathIn(path, taskDir, bin)
}