Small sh "framework" to test some server responses
sh
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 806B

123456789101112131415161718192021222324252627282930313233343536373839
  1. VERSION=1.1
  2. NAME=shcheck
  3. CHECKS=$(wildcard checks/*.sh)
  4. DIST=$(NAME).sh
  5. DIST_EXAMPLE=$(NAME)_example.sh
  6. PKG=$(NAME)-$(VERSION)
  7. PKG_GZ=$(PKG).tar.gz
  8. PKG_BZ2=$(PKG).tar.bz2
  9. PKGS=$(PKG_GZ) $(PKG_BZ2)
  10. all: lint
  11. $(PKGS): $(DIST) $(DIST_EXAMPLE) README
  12. tar --xform='s|^|./$(NAME)-$(VERSION)/|' -acvf "$@" $^
  13. $(DIST).bz2: $(DIST)
  14. tar -acvf
  15. $(DIST_EXAMPLE): example.sh
  16. sed 's|^\. \./check.sh$$|. ./$(DIST)|' < $^ > $@; \
  17. chmod +x $@; \
  18. $(MAKE) lint_dist
  19. $(DIST): check.sh $(CHECKS)
  20. grep -Ev '^\. \./checks/.*\.sh$$' > $@ < $<; \
  21. cat $(CHECKS) | grep -v '^#' >> $@;
  22. lint_dist: $(DIST) $(DIST_EXAMPLE)
  23. shellcheck $^
  24. lint: example.sh check.sh $(CHECKS)
  25. shellcheck -x example.sh check.sh && \
  26. [ -f "$(DIST)" ] && $(MAKE) lint_dist
  27. .PHONY: clean
  28. clean:
  29. -rm -vf $(DIST) $(DIST_EXAMPLE) $(PKGS)