123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- #!/usr/bin/env bash
- # THIS IS A SCRIPT i USE TO CREATE AND UPDATE THE APPLICATION LIST ON https://portable-linux-apps.github.io/
- # ONCE CREATED, THE PAGE WILL APPEAR LIKE THIS: https://portable-linux-apps.github.io/apps.html
- # FIRST OF ALL, WE NEED TO CREATE A FILE CONTAINING ALL THE ARGUMENTS THAT THIS SCRIPT MUST READ
- cd $(xdg-user-dir DESKTOP)
- AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main"
- arch="x86_64"
- echo "" >> args
- cp /opt/am/$arch-apps $arch-apps && echo -e "$(cat ./$arch-apps | awk -v FS="(◆ | : )" '{print $2}')" >> args
- echo STOP >> args
- ARGS=$(sed '1d' ./args)
- echo "# APPLICATIONS
- | [Home](https://portable-linux-apps.github.io/) |
- | --- |
- #### 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.
- *Use your browser's built-in search tool to easily navigate to this page.*
- #### *This database contains* **$(echo $(($(wc -l ./args | tail -5 | head -1 | grep -Eo "[0-9]*") - 2)))** *Appimage packages and standalone applications*.
- -----------------
- | ICON | PACKAGE NAME | DESCRIPTION | INSTALLER |
- | --- | --- | --- | --- |" >> apps.md
- # THIS IS THE WORKFLOW
- for arg in $ARGS; do
- for var in $arg; do
- if [ $arg == STOP ]; then
- break
- else
- case $arg in
- am) ;;
- appman) ;;
- *) for var in $arg;
- do
- description=$(cat $arch-apps | grep "◆ $arg :" | sed 's/^.*: //' | sed 's/ *$//')
- 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
- sleep 0.005
- done;;
- esac
- fi
- done
- done
- echo "
- ---
- 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).
- ***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.***
- ---
- | [Home](https://portable-linux-apps.github.io/) |
- | --- |
- --------
- # Contacts
- - **Ivan-HC** *on* [**GitHub**](https://github.com/ivan-hc)
- - **AM-Ivan** *on* [**Reddit**](https://www.reddit.com/u/am-ivan)
- ###### *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!*
- --------
- *© 2020-present Ivan Alesandro Sala aka '"'Ivan-HC'"'* - I'm here just for fun!
- " >> apps.md
- wget https://raw.githubusercontent.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io/main/README.md -O README.old
- sed -n '1,6p' ./README.old >> ./README.md
- 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
- sed -n '8,190p' ./README.old >> ./README.md
- # ADD A JSON VERSION OF THE LIST ABOVE
- echo "[" >> apps.json
- for arg in $ARGS; do
- for var in $arg; do
- if [ $arg == STOP ]; then
- break
- else
- case $arg in
- am) ;;
- appman) ;;
- *) for var in $arg;
- do
- description=$(cat $arch-apps | grep "◆ $arg :" | sed 's/"//g' | sed 's/^.*: //')
- echo -e ' {\n "packageName": "'$arg'",\n "description": "'$description'..",\n "icon": "https://portable-linux-apps.github.io/icons/'$arg'.png"\n },' >> apps.json
- sleep 0.005
- done;;
- esac
- fi
- done
- done
- sed -i '$s/,$//' apps.json
- echo -e "]" >> apps.json
- rm ./args ./README.old ./$arch-apps
|