test: int suite fixes

This commit is contained in:
2024-07-17 13:22:14 +02:00
parent e5a6dea10c
commit 8b8e158664
20 changed files with 115 additions and 79 deletions

View File

@ -576,6 +576,7 @@ func (a App) WriteRecipeVersion(version string) error {
}
defer file.Close()
skipped := false
scanner := bufio.NewScanner(file)
lines := []string{}
for scanner.Scan() {
@ -590,6 +591,12 @@ func (a App) WriteRecipeVersion(version string) error {
continue
}
if strings.Contains(line, version) {
skipped = true
lines = append(lines, line)
continue
}
splitted := strings.Split(line, ":")
line = fmt.Sprintf("%s:%s", splitted[0], version)
lines = append(lines, line)
@ -603,7 +610,11 @@ func (a App) WriteRecipeVersion(version string) error {
log.Fatal(err)
}
log.Infof("version %s saved to %s.env", version, a.Domain)
if !skipped {
log.Infof("version %s saved to %s.env", version, a.Domain)
} else {
log.Debugf("skipping version %s write as already exists in %s.env", version, a.Domain)
}
return nil
}