search python in the same folder as mercurial

This commit is contained in:
Sebastian Sdorra
2011-05-13 17:05:48 +02:00
parent d05ef90956
commit 4b30fc50ce

View File

@@ -76,10 +76,32 @@ public class UnixHgInstaller extends AbstractHgInstaller
{
super.install(baseDirectory, config);
// search mercurial (hg)
if (Util.isEmpty(config.getHgBinary()))
{
config.setHgBinary(IOUtil.search(COMMAND_HG));
String hg = IOUtil.search(COMMAND_HG);
if (Util.isNotEmpty(hg))
{
config.setHgBinary(hg);
// search python in the same folder
File hgFile = new File(hg);
if (hgFile.exists())
{
File pythonFile = new File(hgFile.getParentFile(), COMMAND_PYTHON);
if (pythonFile.exists())
{
config.setPythonBinary(pythonFile.getAbsolutePath());
}
}
}
}
// search python
if (Util.isEmpty(config.getPythonBinary()))
{