Skip to content

Commit

Permalink
Fix loading config from default paths after merging #199.
Browse files Browse the repository at this point in the history
This regression was introduced by #199. cfgFiles does point to a slice,
but it was not checked if the slice was empty or not. Therefore, no
configuration file was read if the -c parameter was not used.

Closes chirpstack/chirpstack-docker#74 and
chirpstack/chirpstack-docker#75.
  • Loading branch information
brocaar committed Jan 30, 2023
1 parent d411d3b commit b291ead
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/chirpstack-gateway-bridge/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func Execute(v string) {
}

func initConfig() {
if cfgFiles != nil {
if cfgFiles != nil && len(*cfgFiles) != 0 {
var filesMerged []byte
for _, cfgFile := range *cfgFiles {
cfgFileContent, err := ioutil.ReadFile(cfgFile)
Expand Down

0 comments on commit b291ead

Please sign in to comment.