fix: add flag for stable/incubator

This commit is contained in:
Devin Buhl 2021-03-18 11:48:27 -04:00
parent 6c6bc95452
commit 53f9166783
No known key found for this signature in database
GPG Key ID: 77149AC618D714D6

View File

@ -2,7 +2,7 @@
set -eu
# Generate helm-docs for Helm charts
# Usage ./gen-helm-docs.sh [chart]
# Usage ./gen-helm-docs.sh [stable/incubator] [chart]
# require helm-docs
command -v helm-docs >/dev/null 2>&1 || {
@ -19,11 +19,11 @@ readme_config_template="${repository}/hack/templates/README_CONFIG.md.gotmpl"
readme_changelog_template="${repository}/hack/templates/README_CHANGELOG.md.gotmpl"
# Gather all charts using the common library, excluding common-test
charts=$(find "${repository}" -name "Chart.yaml" -exec grep --exclude="*common-test*" -l "\- name\: common" {} \;)
charts=$(find "${repository}" -name "Chart.yaml")
# Allow for a specific chart to be passed in as a argument
if [ $# -ge 1 ] && [ -n "$1" ]; then
charts="${repository}/charts/$1/Chart.yaml"
if [ $# -ge 1 ] && [ -n "$1" ] && [ -n "$2" ]; then
charts="${repository}/charts/$1/$2/Chart.yaml"
root="$(dirname "${charts}")"
if [ ! -f "$charts" ]; then
echo "File ${charts} does not exist."