Skip to content

Commit 9c5d53d

Browse files
committed
bugfix: fix template and rendering issue with init config
1 parent 4cde6fb commit 9c5d53d

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

pkg/cmd/init.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ func NewInitOptions(chart, path, ghOwner, ghName, author, email string) (*InitOp
133133
return nil, err
134134
}
135135
author = s
136+
log.WithField("author", author).Debug("got author from git config")
136137
}
137138

138139
if email == "" {
@@ -142,6 +143,7 @@ func NewInitOptions(chart, path, ghOwner, ghName, author, email string) (*InitOp
142143
return nil, err
143144
}
144145
email = s
146+
log.WithField("email", email).Debug("got email from git config")
145147
}
146148

147149
return &InitOptions{

pkg/templates/templates.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,20 @@ var ConfigFileTemplate = heredoc.Doc(`
2929
{{ .Header }}
3030
version: v1
3131
chart:
32-
name: {{ .Chart }}
33-
{{- if .Path }}path: {{ .Path }}{{ end }}
34-
repo: github.com/{{ .GithubOwner }}/{{ .GithubName }}
32+
name: {{ .Chart }}{{ if .Path }}
33+
path: {{ .Path }}{{ end }}
34+
repo: github.com/{{ .GithubOwner }}/{{ .GithubName }}
3535
commit:
3636
author:
3737
name: {{ .AuthorName }}
38-
email: {{ .Author.Email }}
38+
email: {{ .AuthorEmail }}
3939
`)
4040

4141
// ConfigHeaderComment is the header comment which is applied to the generated config file.
4242
var ConfigHeaderComment = heredoc.Doc(`
4343
# .chartreleaser.yaml is the configuration file for chart-releaser, a CI tool
4444
# to update Helm Charts on application release. See the documentation at
4545
# https://github.com/edaniszewski/chart-releaser
46-
4746
`)
4847

4948
// DefaultUpdateCommitMessage is the default template for a commit message used when

pkg/v1/v1.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ func (f *Formatter) Run(opts FormatterOptions) error {
114114
data = append(data, yml...)
115115
} else {
116116
data = []byte(templates.ConfigHeaderComment)
117+
data = append(data, []byte("\n")...)
117118
data = append(data, yml...)
118119
}
119120
return ioutil.WriteFile(opts.Path, data, 0644)

0 commit comments

Comments
 (0)