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.

62 lines
2.9 KiB

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