| 44 | |
| 45 | if (PATH.isSome()) { |
| 46 | foreach (const string& path, strings::split(PATH.get(), ":")) { |
| 47 | Try<list<string>> matches = fs::list(path::join(path, "mesos-*")); |
| 48 | if (matches.isSome()) { |
| 49 | foreach (const string& match, matches.get()) { |
| 50 | Try<bool> access = os::access(match, X_OK); |
| 51 | if (access.isSome() && access.get()) { |
| 52 | string basename = Path(match).basename(); |
| 53 | if (basename != "mesos-slave") { |
| 54 | commands.push_back(basename.substr(6)); |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | cerr |