Skip to content

Commit

Permalink
fix empty variables check
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Guzelevich committed Mar 28, 2018
1 parent 3a3b0b9 commit 11dea66
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/junocfg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,17 @@ func main() {
checkFatal("RenderAndCheckTemplate error %v", err)

// check variables
errorsCount := 0
strOut := strings.Split(out, "\n")
for posInFile, str := range strOut {
if i := strings.Index(str, "<no value>"); i != -1 {
log.Stderr.Printf("<no value> at %s#%d:%s\n", output, posInFile, str)
errorsCount++
}
}
if errorsCount > 0 {
checkFatal("Empty variables %v", fmt.Errorf("%d", errorsCount))
}
outResult(output, out)
}
}

0 comments on commit 11dea66

Please sign in to comment.