feat: template example domain in release notes
See toolshed/organising#521
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user