Skip to content

Commit

Permalink
fix: makes it so charts with empty values files still get helm-docs-v…
Browse files Browse the repository at this point in the history
…ersion footers
  • Loading branch information
norwoodj committed Oct 4, 2020
1 parent 491d5d9 commit 8bb2011
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ repos:
args:
- --chart-search-root=example-charts
- --template-files=./_templates.gotmpl
- --template-files=README.gotmpl
- --template-files=README.md.gotmpl
- --log-level=debug
1 change: 1 addition & 0 deletions pkg/document/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func getChartTemplateData(chartDocumentationInfo helm.ChartDocumentationInfo, he
if chartDocumentationInfo.ChartValues.Kind == 0 {
return chartTemplateData{
ChartDocumentationInfo: chartDocumentationInfo,
HelmDocsVersion: helmDocsVersion,
Values: make([]valueRow, 0),
}, nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/document/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func getHelmDocsVersionTemplates() string {
versionSectionBuilder := strings.Builder{}
versionSectionBuilder.WriteString(`{{ define "helm-docs.version" }}{{ if .HelmDocsVersion }}{{ .HelmDocsVersion }}{{ end }}{{ end }}`)
versionSectionBuilder.WriteString(`{{ define "helm-docs.versionFooter" }}`)
versionSectionBuilder.WriteString("\n{{ if .HelmDocsVersion }}\n")
versionSectionBuilder.WriteString("{{ if .HelmDocsVersion }}\n")
versionSectionBuilder.WriteString("----------------------------------------------\n")
versionSectionBuilder.WriteString("Autogenerated from chart metadata using [helm-docs v{{ .HelmDocsVersion }}](https://github.com/norwoodj/helm-docs/releases/v{{ .HelmDocsVersion }})")
versionSectionBuilder.WriteString("{{ end }}")
Expand Down

0 comments on commit 8bb2011

Please sign in to comment.