esv: improve configuration path code
This commit is contained in:
parent
3507d9ca24
commit
692d413bfa
1 changed files with 5 additions and 6 deletions
11
esv.d
11
esv.d
|
@ -108,12 +108,12 @@ config:
|
||||||
configPath = environment.get(cf.configEnv, cf.configPath)
|
configPath = environment.get(cf.configEnv, cf.configPath)
|
||||||
.expandTilde();
|
.expandTilde();
|
||||||
try {
|
try {
|
||||||
if (cFlag) {
|
if (cFlag)
|
||||||
configPath = cFlag.expandTilde();
|
configPath = cFlag.expandTilde();
|
||||||
} else {
|
|
||||||
if (!configPath.exists()) {
|
if (!configPath.exists()) {
|
||||||
mkdirRecurse(dirName(configPath));
|
mkdirRecurse(dirName(configPath));
|
||||||
configPath.write(format!
|
configPath.write(format!
|
||||||
"## Configuration file for esv.
|
"## Configuration file for esv.
|
||||||
|
|
||||||
# An API key is required to access the ESV Bible API.
|
# An API key is required to access the ESV Bible API.
|
||||||
|
@ -127,7 +127,6 @@ key = %s
|
||||||
#passage-references = false
|
#passage-references = false
|
||||||
#verse-numbers = false
|
#verse-numbers = false
|
||||||
"(cf.apiKey));
|
"(cf.apiKey));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
readINIFile(ini, configPath);
|
readINIFile(ini, configPath);
|
||||||
} catch (FileException e) {
|
} catch (FileException e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue