checkscripts 592 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. #
  3. # checkscripts
  4. #
  5. # Build script checker for the Dragora GNU/Linux-Libre website
  6. # (https://www.dragora.org)
  7. #
  8. PROGNAME=checkscripts
  9. COMMANDS='find shellcheck'
  10. BUILD_SCRIPT=build
  11. PAGES_DIR=source/pages
  12. HEADER_SCRIPT=header_params
  13. FOOTER_SCRIPT=footer_params
  14. for cmd in $COMMANDS
  15. do
  16. command -v shellcheck >/dev/null || \
  17. { printf '%s\n' "${PROGNAME}: command not found -- $cmd"; exit 1; }
  18. done
  19. shellcheck -e 2154 -e 1090 "$BUILD_SCRIPT"
  20. for fl in \
  21. $(find "$PAGES_DIR" -type f -name "$HEADER_SCRIPT" -o -name "$FOOTER_SCRIPT")
  22. do
  23. shellcheck -s sh -e 2034 "$fl"
  24. done