feat: template example domain in release notes
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

See toolshed/organising#521
This commit is contained in:
2025-08-30 12:45:48 +02:00
parent 09176801e1
commit 4c9abbf925
6 changed files with 59 additions and 34 deletions

View File

@ -5,6 +5,7 @@ import (
"fmt"
"os"
"path"
"strings"
"coopcloud.tech/abra/pkg/envfile"
"coopcloud.tech/abra/pkg/formatter"
@ -20,7 +21,7 @@ func (r Recipe) SampleEnv() (map[string]string, error) {
}
// GetReleaseNotes prints release notes for the recipe version
func (r Recipe) GetReleaseNotes(version string) (string, error) {
func (r Recipe) GetReleaseNotes(version, appDomain string) (string, error) {
if version == "" {
return "", nil
}
@ -36,7 +37,14 @@ func (r Recipe) GetReleaseNotes(version string) (string, error) {
title := formatter.BoldStyle.Render(i18n.G("%s release notes:", version))
withTitle := fmt.Sprintf("%s\n%s\n", title, releaseNotes)
return withTitle, nil
templatedDomain := strings.Replace(
withTitle,
fmt.Sprintf("%s.example.com", r.Name),
appDomain,
-1,
)
return templatedDomain, nil
}
return "", nil