static String guessUnixShell()

in cmake-runner-agent/src/jetbrains/buildServer/cmakerunner/agent/util/OSUtil.java [71:90]


  static String guessUnixShell(@NotNull final Map<String, String> environment) {
    for (final String candidate : UNIX_SHELL_CANDIDATES) {
      final String found = FileUtil2.findExecutableByNameInPATH(candidate, environment);
      if (found != null) {
        LOG.info("Found '" + found + "' interpreter in PATH");
        return found;
      }
    }
    for (final String location : UNIX_SHELL_LOCATIONS) {
      for (final String candidate : UNIX_SHELL_CANDIDATES) {
        final String absolute = location + "/" + candidate;
        if (FileUtil2.checkIfExists(absolute)) {
          LOG.info("Found '" + absolute + "' interpreter");
          return absolute;
        }
      }
    }
    LOG.info("No shell found either in PATH nor manually in " + Arrays.toString(UNIX_SHELL_LOCATIONS) + " directories");
    return null;
  }