Installed package searching

This commit is contained in:
Christian Colglazier 2021-01-12 15:35:28 -05:00
parent dcfc056cb0
commit edce94d03c
2 changed files with 6 additions and 1 deletions

View File

@ -34,6 +34,11 @@ function checkUptoDate() {
fi
}
# Returns installed programs with a given name.
function searchProgramInstalled() {
sudo dnf list | grep $1
}
# Filters string to Semantic Versioning.
function filterVersion() {
grep -Po -m 1 '\d{1,4}\.\d{1,4}\.*\d{0,4}'

View File

@ -5,7 +5,7 @@
# Import library
source $(dirname ${BASH_SOURCE[0]})/install-lib.sh
keeweb=$(sudo dnf list | grep KeeWeb)
keeweb=$(searchProgramInstalled KeeWeb)
keewebVersion=$(echo $keeweb | awk '{print $2;}' | filterVersion)
url=$(curl -s https://github.com/keeweb/keeweb/releases | grep .rpm | grep -Po '(?<=href=")[^"]*.rpm'| head -n 1)
url='https://github.com'$url