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.

49 lines
2.1 KiB

  1. #!/usr/bin/make -f
  2. SHELL = /bin/bash
  3. all: checks
  4. checks: missinglicenselanguage nofullstop
  5. noexternallink:
  6. @echo "Lines 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. missinglicenselanguage:
  9. @echo "Lines 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 "Lines 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. contrib:
  16. @git shortlog -sne
  17. add:
  18. @#add a new entry
  19. @printf 'Software name: ' ;\
  20. read Name; if [ -z "$$Name" ]; then printf 'Missing software name!\n'; exit 1 ; fi ;\
  21. printf 'Homepage URL: ' ;\
  22. read Url; if [ -z "$$Url" ]; then printf 'Missing main project URL!\n'; exit 1 ; fi ;\
  23. printf 'Description (max 250 char): ' ;\
  24. read Description; if [ -z "$$Description" ]; then printf 'Missing description!\n'; exit 1 ; fi ;\
  25. printf 'License: ' ;\
  26. read License; if [ -z "$$License" ]; then printf 'Missing license!\n'; exit 1 ; fi ;\
  27. printf 'Main server-side language/platform/requirement: ' ;\
  28. read Language; if [ -z "$$Language" ]; then printf 'Missing language!\n'; exit 1 ; fi ;\
  29. printf 'Demo URL (if any): ' ;\
  30. read Demo; if [ -z "$$Demo" ]; then CDemo="" ; else CDemo="[Demo]($$Demo)" ; fi ;\
  31. printf 'Source code URL (if different from Homepage): ' ;\
  32. read Source; if [ -z "$$Source" ]; then CSource="" ; else CSource="[Source Code]($$Source)" ; fi ;\
  33. if [[ "$$CSource" == "" && "$$Demo" == "" ]]; \
  34. then Moreinfo="";\ printf "debug" ;\
  35. else Moreinfo=$$(echo "($$CSource$$CDemo)" | sed 's|)\[|\], [|g') ;\
  36. fi ;\
  37. echo -e "Copy this entry to your clipboard, paste it in the appropriate category:\n\n" ;\
  38. echo " * [$$Name]($$Url) - $${Description}. $$Moreinfo \`$$License\` \`$$Language\`"
  39. #TODO ask for category and insert item accordingly
  40. #TODO check for unsorted entries
  41. #TODO automatically sort entries/sections
  42. #TODO autoupdate contributors list