Sybren A. Stüvel e394e75f64 update-version: also update latest version on project website
`make update-version` now also updates
`web/project-website/data/flamenco.yaml` so that the new version is
listed as the latest one on flamenco.blender.org.

Note that such a change will only be visible online after publishing the
site with `make project-website`. Be sure to only do this after the
build has been uploaded there, to avoid dead links.
2022-08-31 15:14:46 +02:00

29 lines
644 B
Go

package main
import (
"fmt"
"strings"
"github.com/rs/zerolog/log"
)
const websiteFile = "web/project-website/data/flamenco.yaml"
// updateWebsite changes the version number of the latest version in the project
// website.
// Returns whether the file actually changed.
func updateWebsite() bool {
replacer := func(line string) string {
if !strings.HasPrefix(line, "latestVersion: ") {
return line
}
return fmt.Sprintf("latestVersion: %s", cliArgs.newVersion)
}
fileWasChanged, err := updateLines(websiteFile, replacer)
if err != nil {
log.Fatal().Err(err).Msg("error updating project website")
}
return fileWasChanged
}