File tree Expand file tree Collapse file tree 3 files changed +7
-59
lines changed Expand file tree Collapse file tree 3 files changed +7
-59
lines changed Original file line number Diff line number Diff line change @@ -198,7 +198,6 @@ clean-clientset: ## Remove all generated clientset files
198198.PHONY : verify
199199verify :
200200 ./hack/verify-boilerplate.sh
201- ./hack/verify-clientset.sh
202201 ./hack/verify-bazel.sh
203202 ./hack/verify-doctoc.sh
204203
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ set -o errexit
1818set -o nounset
1919set -o pipefail
2020
21+ command -v doctoc || echo " doctoc is not available on your system, skipping verification" && exit 0
22+
2123doctoc_files=" README.md \
2224 CONTRIBUTING.md \
2325 cmd/clusterctl/README.md \
@@ -33,24 +35,24 @@ function check_doctoc(){
3335 changed_files=" "
3436 for file in $doctoc_files
3537 do
36- res=$( git diff --cached $file )
38+ res=$( git diff --cached " $file " )
3739 if [ " $res " ]
3840 then
3941 changed_files=" $changed_files \n$file "
4042 fi
4143 done
4244
43- if [ $ changed_files ]; then
45+ if [ " ${ changed_files} " ]; then
4446 echo -e " Please update these files: $changed_files ."
4547 echo " Update with doctoc FILENAME."
4648 echo " Re-commit with -n/--no-verify option."
47- exit - 1
49+ exit 1
4850 fi
4951
5052}
5153
52- doctoc $ doctoc_files > /dev/null 2>&1
54+ doctoc " ${ doctoc_files} " > /dev/null 2>&1
5355check=$( git diff)
54- if [ ! -z " $check " ]; then
56+ if [ -n " $check " ]; then
5557 check_doctoc
5658fi
You can’t perform that action at this time.
0 commit comments