Mirror of Awesome Self Hosted
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.

72 lines
3.0 KiB

  1. #!/usr/bin/make -f
  2. SHELL = /bin/bash
  3. all: checks
  4. checks: nolicenselanguage nofullstop longdescriptions syntaxerrors
  5. monthly: checks awesome_bot check_github_commit_dates contrib
  6. noexternallink:
  7. @echo -e "\nLines with no source/demo/other link:"
  8. @sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep '^ *\* ' | egrep --color=always '[a-z\.] `'
  9. nolicenselanguage:
  10. @echo -e "\nLines with only 1 or no language/license entry:"
  11. @! sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep '^ *\* ' | egrep -v '` `'
  12. nofullstop:
  13. @echo -e "\nLines without a full stop after description:"
  14. @! sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep '[a-z] \(\['
  15. @! sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep '[a-z] `'
  16. longdescriptions:
  17. @echo -e "\nDescriptions exceeding 250 chars:"
  18. @! sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep --only-matching '\) - [Aa-Zz|.|\(|\)|/| |,|-]*\s\(\[' README.md | grep '.\{257\}'
  19. syntaxerrors:
  20. @echo -e "\nSyntax errors:"
  21. @! sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep '\)\(|``|\)`'
  22. #################################
  23. contrib:
  24. @mv .github/.mailmap . && printf "|Commits | Author |\n| :---: | --- |\n" > AUTHORS.md && git shortlog -sne | sed -r 's/^\s*([[:digit:]]*?)\s*?(.*?)/|\1|\2|/' >> AUTHORS.md && mv .mailmap .github/.mailmap
  25. awesome_bot:
  26. # https://github.com/dkhamsing/awesome_bot
  27. awesome_bot --allow-redirect --allow 202 -f README.md
  28. check_github_commit_dates:
  29. python3 tests/check-github-commit-dates.py
  30. #################################
  31. add:
  32. @#add a new entry
  33. @printf 'Software name: ' ;\
  34. read Name; if [ -z "$$Name" ]; then printf 'Missing software name!\n'; exit 1 ; fi ;\
  35. printf 'Homepage URL: ' ;\
  36. read Url; if [ -z "$$Url" ]; then printf 'Missing main project URL!\n'; exit 1 ; fi ;\
  37. printf 'Description (max 250 characters, ending with .): ' ;\
  38. read Description; if [ -z "$$Description" ]; then printf 'Missing description!\n'; exit 1 ; fi ;\
  39. printf 'License: ' ;\
  40. read License; if [ -z "$$License" ]; then printf 'Missing license!\n'; exit 1 ; fi ;\
  41. printf 'Main server-side language/platform/requirement: ' ;\
  42. read Language; if [ -z "$$Language" ]; then printf 'Missing language!\n'; exit 1 ; fi ;\
  43. printf 'Demo URL (if any): ' ;\
  44. read Demo; if [ -z "$$Demo" ]; then CDemo="" ; else CDemo="[Demo]($$Demo)" ; fi ;\
  45. printf 'Source code URL (if different from Homepage): ' ;\
  46. read Source; if [ -z "$$Source" ]; then CSource="" ; else CSource="[Source Code]($$Source)" ; fi ;\
  47. if [[ "$$CSource" == "" && "$$Demo" == "" ]]; \
  48. then Moreinfo=""; \
  49. else Moreinfo=$$(echo "($$CDemo$$CSource)" | sed 's|)\[|), [|g') ;\
  50. fi ;\
  51. echo -e "Copy this entry to your clipboard, paste it in the appropriate category:\n\n" ;\
  52. echo "- [$$Name]($$Url) - $${Description} $${Moreinfo} \`$$License\` \`$$Language\`"
  53. #TODO ask for category and insert item accordingly
  54. #TODO check for unsorted entries
  55. #TODO automatically sort entries/sections
  56. #TODO autoupdate contributors list