github.com/noironetworks/cilium-net@v1.6.12/contrib/scripts/check-cmdref.sh (about) 1 #!/bin/bash 2 3 set -e 4 5 MAKE=${MAKE:-make} 6 DOCS_DIR=./Documentation 7 OLD_DIR=${DOCS_DIR}/cmdref 8 TMP_DIR=`mktemp -d` 9 trap 'rm -rf $TMP_DIR' EXIT INT TERM 10 11 ${MAKE} CMDREFDIR=${TMP_DIR} -C ${DOCS_DIR} cmdref 12 13 if ! diff -x '*.rst' -r ${OLD_DIR} ${TMP_DIR}; then 14 # echo is used here intentional to avoid the splat when running from top 15 # level directory. 16 echo "Detected a difference in the cmdref directory" 17 echo "diff -r: `diff -r ${OLD_DIR} ${TMP_DIR}`" 18 echo "Please rerun 'make -C Documentation cmdref' and commit your changes" 19 exit 1 20 fi