File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,23 +24,25 @@ function error() {
2424 log >&2 " ${COLOR_ERROR} ERROR${COLOR_RESET} : ${1} "
2525}
2626
27- if [[ -z " ${DOC_TYPE} " ]]; then
28- error " No doc type given as first parameter!"
29- error " ${USAGE} "
30- exit 1
31- fi
32-
33- if [[ -z " ${CHART_FILE} " ]]; then
34- error " No chart file given as second parameter!"
35- error " ${USAGE} "
36- exit 1
37- fi
38-
39- if [[ -z " ${HELM_DOCS_DIR} " ]]; then
40- error " No helm docs dir given as third parameter!"
41- error " ${USAGE} "
42- exit 1
43- fi
27+ function validate_args() {
28+ if [[ -z " ${DOC_TYPE} " ]]; then
29+ error " No doc type given as first argument!"
30+ error " ${USAGE} "
31+ exit 1
32+ fi
33+
34+ if [[ -z " ${CHART_FILE} " ]]; then
35+ error " No chart file given as second argument!"
36+ error " ${USAGE} "
37+ exit 1
38+ fi
39+
40+ if [[ -z " ${HELM_DOCS_DIR} " ]]; then
41+ error " No helm docs dir given as third argument!"
42+ error " ${USAGE} "
43+ exit 1
44+ fi
45+ }
4446
4547function generate_docs() {
4648 local chart_search_root output_file base_template docs_template dockerhub_template
@@ -132,6 +134,8 @@ function generate_hook_docs() {
132134}
133135
134136function main() {
137+ validate_args
138+
135139 case " ${DOC_TYPE} " in
136140 " --scanner" )
137141 generate_scanner_docs
You can’t perform that action at this time.
0 commit comments