Code Review
/
src
/
xds
/
xds-cli.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
|
inline
| side by side (parent:
f48c7c3
)
Support ~ or $VAR for --config option value
author
Sebastien Douheret
<sebastien.douheret@iot.bzh>
Thu, 7 Dec 2017 14:59:39 +0000
(15:59 +0100)
committer
Sebastien Douheret
<sebastien.douheret@iot.bzh>
Thu, 7 Dec 2017 14:59:39 +0000
(15:59 +0100)
main.go
patch
|
blob
|
history
diff --git
a/main.go
b/main.go
index
c8effe6
..
ad237af
100644
(file)
--- a/
main.go
+++ b/
main.go
@@
-232,11
+232,16
@@
func main() {
// Load config file if requested
if confFile != "" {
earlyPrintf("confFile detected: %v", confFile)
// 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
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)
}
if err != nil {
exitError(1, "Error loading env config file "+confFile)
}