forked from toolshed/abra
test: int suite fixes
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user