am2pla-site 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #!/usr/bin/env bash
  2. # THIS IS A SCRIPT i USE TO CREATE AND UPDATE THE APPLICATION LIST ON https://portable-linux-apps.github.io/
  3. # ONCE CREATED, THE PAGE WILL APPEAR LIKE THIS: https://portable-linux-apps.github.io/apps.html
  4. # FIRST OF ALL, WE NEED TO CREATE A FILE CONTAINING ALL THE ARGUMENTS THAT THIS SCRIPT MUST READ
  5. cd $(xdg-user-dir DESKTOP)
  6. AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main"
  7. arch="x86_64"
  8. echo "" >> args
  9. cp /opt/am/$arch-apps $arch-apps && echo -e "$(cat ./$arch-apps | awk -v FS="(◆ | : )" '{print $2}')" >> args
  10. echo STOP >> args
  11. ARGS=$(sed '1d' ./args)
  12. echo "# APPLICATIONS
  13. | [Home](https://portable-linux-apps.github.io/) |
  14. | --- |
  15. #### Here are listed all the apps managed by [AM](https://github.com/ivan-hc/AM) and [AppMan](https://github.com/ivan-hc/AppMan) for the x86_64 architecture.
  16. *Use your browser's built-in search tool to easily navigate to this page.*
  17. #### *This database contains* **$(echo $(($(wc -l ./args | tail -5 | head -1 | grep -Eo "[0-9]*") - 2)))** *Appimage packages and standalone applications*.
  18. -----------------
  19. | ICON | PACKAGE NAME | DESCRIPTION | INSTALLER |
  20. | --- | --- | --- | --- |" >> apps.md
  21. # THIS IS THE WORKFLOW
  22. for arg in $ARGS; do
  23. for var in $arg; do
  24. if [ $arg == STOP ]; then
  25. break
  26. else
  27. case $arg in
  28. am) ;;
  29. appman) ;;
  30. *) for var in $arg;
  31. do
  32. description=$(cat $arch-apps | grep "◆ $arg :" | sed 's/^.*: //' | sed 's/ *$//')
  33. echo '| <img src="icons/'$arg'.png" width="48" height="48"> | [***'$arg'***](apps/'$arg'.md) | *'$description'*..[ *read more* ](apps/'$arg'.md)*!* | [*blob*](https://github.com/ivan-hc/AM/blob/main/programs/'$arch'/'$arg') **/** [*raw*](https://raw.githubusercontent.com/ivan-hc/AM/main/programs/'$arch'/'$arg') |' >> apps.md
  34. sleep 0.005
  35. done;;
  36. esac
  37. fi
  38. done
  39. done
  40. echo "
  41. ---
  42. You can improve these pages via a [pull request](https://github.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io/pulls) to this site's [GitHub repository](https://github.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io), or report any problems related to the installation scripts in the '[issue](https://github.com/ivan-hc/AM/issues)' section of the main database, at [https://github.com/ivan-hc/AM](https://github.com/ivan-hc/AM).
  43. ***PORTABLE-LINUX-APPS.github.io is my gift to the Linux community and was made with love for GNU/Linux and the Open Source philosophy.***
  44. ---
  45. | [Home](https://portable-linux-apps.github.io/) |
  46. | --- |
  47. --------
  48. # Contacts
  49. - **Ivan-HC** *on* [**GitHub**](https://github.com/ivan-hc)
  50. - **AM-Ivan** *on* [**Reddit**](https://www.reddit.com/u/am-ivan)
  51. ###### *You can support me and my work on [**ko-fi.com**](https://ko-fi.com/IvanAlexHC) and [**PayPal.me**](https://paypal.me/IvanAlexHC). Thank you!*
  52. --------
  53. *© 2020-present Ivan Alesandro Sala aka '"'Ivan-HC'"'* - I'm here just for fun!
  54. " >> apps.md
  55. wget https://raw.githubusercontent.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io/main/README.md -O README.old
  56. sed -n '1,6p' ./README.old >> ./README.md
  57. echo "##### This site lists **$(echo $(($(wc -l ./args | tail -5 | head -1 | grep -Eo "[0-9]*") - 2)))** Appimage packages and standalone applications. From here you can download them, install them, update them (for real), get more information about the sources and their developers... and if you want, you can contribute yourself by adding the missing information, because this site is **open source**!" >> ./README.md
  58. sed -n '8,190p' ./README.old >> ./README.md
  59. # ADD A JSON VERSION OF THE LIST ABOVE
  60. echo "[" >> apps.json
  61. for arg in $ARGS; do
  62. for var in $arg; do
  63. if [ $arg == STOP ]; then
  64. break
  65. else
  66. case $arg in
  67. am) ;;
  68. appman) ;;
  69. *) for var in $arg;
  70. do
  71. description=$(cat $arch-apps | grep "◆ $arg :" | sed 's/"//g' | sed 's/^.*: //')
  72. echo -e ' {\n "packageName": "'$arg'",\n "description": "'$description'..",\n "icon": "https://portable-linux-apps.github.io/icons/'$arg'.png"\n },' >> apps.json
  73. sleep 0.005
  74. done;;
  75. esac
  76. fi
  77. done
  78. done
  79. sed -i '$s/,$//' apps.json
  80. echo -e "]" >> apps.json
  81. rm ./args ./README.old ./$arch-apps