Move description.sh from hack/ to hooks/

Just to get everything in one place...
This commit is contained in:
Eric Paris
2015-08-10 12:38:15 -04:00
parent 302cb7dc7f
commit 985fa94ebd
3 changed files with 17 additions and 36 deletions

View File

@@ -34,17 +34,22 @@ find_files() {
-o -wholename '*/third_party/*' \
-o -wholename '*/Godeps/*' \
\) -prune \
\) -name '*.go'
\) -wholename '*pkg/api/v*/types.go'
}
files=`find_files | egrep "pkg/api/v.[^/]*/types\.go"`
if [[ $# -eq 0 ]]; then
files=`find_files | egrep "pkg/api/v.[^/]*/types\.go"`
else
files=("${@}")
fi
for file in $files
do
if [[ "$("${KUBE_ROOT}/hooks/description.sh" "${file}")" -eq "0" ]]; then
echo "API file is missing the required field descriptions: ${file}"
result=1
fi
for file in $files; do
if grep json: "${file}" | grep -v // | grep -v ,inline | grep -v -q description: ; then
echo "API file is missing the required field descriptions: ${file}"
result=1
fi
done
exit ${result}
# ex: ts=2 sw=2 et filetype=sh