Change-Id: I785ab6bf1823d174394b1d2b25c5bb202535e943tags/v0.11.1
@@ -199,4 +199,15 @@ public abstract class FS { | |||
return null; | |||
return new File(home).getAbsoluteFile(); | |||
} | |||
static File searchPath(final String path, final String... lookFor) { | |||
for (final String p : path.split(File.pathSeparator)) { | |||
for (String command : lookFor) { | |||
final File e = new File(p, command); | |||
if (e.isFile()) | |||
return e.getAbsoluteFile(); | |||
} | |||
} | |||
return null; | |||
} | |||
} |
@@ -62,14 +62,10 @@ class FS_Win32_Cygwin extends FS_Win32 { | |||
}); | |||
if (path == null) | |||
return false; | |||
for (final String p : path.split(";")) { | |||
final File e = new File(p, "cygpath.exe"); | |||
if (e.isFile()) { | |||
cygpath = e.getAbsolutePath(); | |||
return true; | |||
} | |||
} | |||
return false; | |||
File found = FS.searchPath(path, "cygpath.exe"); | |||
if (found != null) | |||
cygpath = found.getPath(); | |||
return cygpath != null; | |||
} | |||
public File resolve(final File dir, final String pn) { |