From 692d413bfa04884c4e2bb736347e170a35dcc257 Mon Sep 17 00:00:00 2001 From: Jeremy Baxter Date: Wed, 26 Jun 2024 09:57:10 +1200 Subject: [PATCH] esv: improve configuration path code --- esv.d | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/esv.d b/esv.d index 186902f..dc2e7f6 100644 --- a/esv.d +++ b/esv.d @@ -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) {