validate-vendor 689 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. source "${MAKEDIR}/.validate"
  3. IFS=$'\n'
  4. files=( $(validate_diff --diff-filter=ACMR --name-only -- 'hack/vendor.sh' 'hack/.vendor-helpers.sh' 'vendor/' || true) )
  5. unset IFS
  6. if [ ${#files[@]} -gt 0 ]; then
  7. # We run vendor.sh to and see if we have a diff afterwards
  8. ./hack/vendor.sh >/dev/null
  9. # Let see if the working directory is clean
  10. diffs="$(git status --porcelain -- vendor 2>/dev/null)"
  11. if [ "$diffs" ]; then
  12. {
  13. echo 'The result of ./hack/vendor.sh differs'
  14. echo
  15. echo "$diffs"
  16. echo
  17. echo 'Please vendor your package with ./hack/vendor.sh.'
  18. echo
  19. } >&2
  20. false
  21. else
  22. echo 'Congratulations! All vendoring changes are done the right way.'
  23. fi
  24. fi