rombert/desktop-maven-notifier — pull request #13 by alexkli (2013-10-22 22:11:26+00:00)
Title: Mac: doesn't find terminal-notifier if in different path

To solve it, added ExecutableLocator that searches the OS
PATH environment variable (by default) for executables.
Only used for the MacOSXNotifier so far, but other notifiers
could use it as well, it has support for windows exe's as well.

Can also be configured with explicit search paths (i.e. no PATH env):

// $PATH by default
ExecutableLocator locator = new ExecutableLocator();
// finding command
if (locator.isAvailable("terminal-notifier")) {
String absPath = locator.getPath("terminal-notifier");
Runtime.exec(absPath);
}

// mixed search path referencing $PATH
locator = new ExecutableLocator(new String[] { "/some/custom/bin", ExecutableLocator.PATH_ENV });

// alternative way of adding search path step by step
locator.clear();
locator.add("/some/custom/bin");
locator.add(ExecutableLocator.PATH_ENV);