/etckeeper/pre-commit.d/20warn-special-file

http://github.com/brinkman83/bashrc · Shell · 12 lines · 9 code · 2 blank · 1 comment · 6 complexity · 03b44959d2414b9cd566c5c667100458 MD5 · raw file

  1. #!/bin/sh
  2. set -e
  3. if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ] || [ "$VCS" = darcs ]; then
  4. special=$(find -not -type d -not -type f -not -type l | grep -v '/\(.git\|.hg\|.bzr\|_darcs\)/') || true
  5. if [ -n "$special" ]; then
  6. echo "etckeeper warning: special files could cause problems with $VCS:" >&2
  7. echo "$special" >&2
  8. fi
  9. fi
  10. true