Added target in config file search.

This commit is contained in:
Christian P. MOMON 2018-01-10 01:03:13 +01:00
parent 43c326e6fe
commit 0ac62b09b2
1 changed files with 16 additions and 0 deletions

View File

@ -115,6 +115,11 @@ public class HebdobotCLI
else
{
configFile = new File(commandLine.getOptionValue("c"));
if (configFile.isDirectory())
{
configFile = new File(configFile, DEFAULT_CONFIG_FILE);
}
}
}
else
@ -125,6 +130,17 @@ public class HebdobotCLI
// directory.
File currentDirectory = new File(System.getProperty("user.dir"));
configFile = new File(currentDirectory, DEFAULT_CONFIG_FILE);
if (!configFile.exists())
{
File configDirectory = new File(currentDirectory.getParentFile(), "conf");
File alternativeConfigFile = new File(configDirectory, DEFAULT_CONFIG_FILE);
if (alternativeConfigFile.exists())
{
configFile = alternativeConfigFile;
}
}
}
if (configFile.exists())