diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-12-07 15:59:39 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-12-07 15:59:39 +0100 |
commit | f888a1c70aaa168e5956f911fd34b7a0a9bc8614 (patch) | |
tree | 079208d97986d8ec9a332eec9c14ddbf4682f1e6 /main.go | |
parent | f48c7c3164b0568de45d7ccc88b0ce7724a17cc4 (diff) |
Support ~ or $VAR for --config option value
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -232,11 +232,16 @@ func main() { // Load config file if requested if confFile != "" { earlyPrintf("confFile detected: %v", confFile) + confFile, err := common.ResolveEnvVar(confFile) + if err != nil { + exitError(1, "Error while resolving confFile: %v", err) + } + earlyPrintf("Resolved confFile: %v", confFile) if !common.Exists(confFile) { exitError(1, "Error env config file not found") } // Load config file variables that will overwrite env variables - err := godotenv.Overload(confFile) + err = godotenv.Overload(confFile) if err != nil { exitError(1, "Error loading env config file "+confFile) } |