esv: improve configuration path code

This commit is contained in:
Jeremy Baxter 2024-06-26 09:57:10 +12:00
parent 3507d9ca24
commit 692d413bfa

11
esv.d
View file

@ -108,12 +108,12 @@ config:
configPath = environment.get(cf.configEnv, cf.configPath)
.expandTilde();
try {
if (cFlag) {
if (cFlag)
configPath = cFlag.expandTilde();
} else {
if (!configPath.exists()) {
mkdirRecurse(dirName(configPath));
configPath.write(format!
if (!configPath.exists()) {
mkdirRecurse(dirName(configPath));
configPath.write(format!
"## Configuration file for esv.
# An API key is required to access the ESV Bible API.
@ -127,7 +127,6 @@ key = %s
#passage-references = false
#verse-numbers = false
"(cf.apiKey));
}
}
readINIFile(ini, configPath);
} catch (FileException e) {