3 export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4 source "${SCRIPTDIR}/.validate"
7 files=( $(validate_diff --diff-filter=ACMR --name-only -- 'api/types/' 'api/swagger.yaml' || true) )
10 if [ ${#files[@]} -gt 0 ]; then
11 ${SCRIPTDIR}/../generate-swagger-api.sh 2> /dev/null
12 # Let see if the working directory is clean
13 diffs="$(git status --porcelain -- api/types/ 2>/dev/null)"
16 echo 'The result of hack/generate-swagger-api.sh differs'
20 echo 'Please update api/swagger.yaml with any api changes, then '
21 echo 'run `hack/generate-swagger-api.sh`.'
25 echo 'Congratulations! All api changes are done the right way.'
28 echo 'No api/types/ or api/swagger.yaml changes in diff.'