()
| 143 | } |
| 144 | |
| 145 | private static String getConfigPath() |
| 146 | { |
| 147 | String aPath = System.getProperty("pcgen.config"); //$NON-NLS-1$ |
| 148 | if (aPath != null) |
| 149 | { |
| 150 | File testPath = new File(aPath); |
| 151 | // Then make sure it's an existing folder |
| 152 | if (testPath.exists() && testPath.isDirectory()) |
| 153 | { |
| 154 | return aPath; |
| 155 | } |
| 156 | } |
| 157 | // Otherwise return command line argument for the settings directory |
| 158 | // Otherwise return user dir |
| 159 | return commandLineArguments.getSettingsDir() |
| 160 | .map(File::getPath) |
| 161 | .orElse(SystemUtils.USER_DIR); |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * Initialize Main - must be called before any other getter can be used. |
no test coverage detected