Skip to content

Commit 5e7105b

Browse files
committed
Refactor tcmsConfigPath to point to the file itself, not the directory
otherwise it needs to be renamed tcmsConfigDir
1 parent 5e3576a commit 5e7105b

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ Minimal config file `~/.tcms.conf`:
5151
username = your-username
5252
password = your-password
5353

54-
You can override the default (user home directory) file location by adding maven option ```tcmsConfigPath```
55-
followed by path to folder containing `.tcms.conf` file.
56-
Example command line usage: ```-DtcmsConfigPath=D:\Path\To\Config\File```
54+
You can override the default file location by adding the Maven option ```tcmsConfigPath```
55+
followed by the full path to a config file. For example:
56+
```-DtcmsConfigPath=D:\Path\To\tcms.conf```
5757

5858
For more info see [tcms-api docs](https://tcms-api.readthedocs.io).
5959

src/main/java/org/kiwitcms/java/config/Config.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ public class Config {
2727

2828
private Config() {
2929
try {
30-
String home_dir = System.getProperty("user.home");
30+
String config_path = System.getProperty("user.home") + "/.tcms.conf");
3131
if (!StringUtils.isBlank(System.getProperty("tcmsConfigPath"))) {
32-
home_dir = System.getProperty("tcmsConfigPath");
32+
config_path = System.getProperty("tcmsConfigPath");
3333
}
34-
config = new IniPreferences(new Ini(new File(home_dir + "/.tcms.conf")));
34+
config = new IniPreferences(new Ini(new File(config_path)));
3535
} catch (java.io.IOException fnfe) {
3636
fnfe.printStackTrace();
3737
}

0 commit comments

Comments
 (0)