diff options
Diffstat (limited to 'repo.sh')
-rwxr-xr-x | repo.sh | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -106,6 +106,7 @@ update_repo() { search_packages() { declare -a key=("${!1}") + LIST_INST=$($0 list | tr '\n' '|') CURL_JSN=$(curl -s $(echo ${URL_PREFIX}${SEARCH_STR}"${key[@]}" | sed -e 's/ /+/g')) OUT_STR=$(jq -r '.results | .[] | [.Name, .Version], .Description' <<< ${CURL_JSN}) SEARCH_OUT=$(sed -e 's/\\//g' -e 's/\[/\\033\[1\;36m\[/g' -e 's/",/\\033\[1\;33m", \[\\033\[1\;32m/g' \ @@ -113,8 +114,8 @@ search_packages() { printf 'You searched using the following keywords (matching package name and/or description): "' printf '%s ' "${key[@]}" printf '\b"\n' - echo -e ${SEARCH_OUT} | sed -e 's/\[ /\n/g' -e 's/ *\] /\n\t/g' -e 's/", / /g' -e 's/"//g' | for i in $($0 list); do - sed '/'"$i"'[^-]/ s/$/ '"$(echo -e \\033\[1\;35m[ Installed ]\\033\[1\;37m)"'/'; done + echo -e ${SEARCH_OUT} | sed -e 's/\[ /\n/g' -e 's/ *\] /\n\t/g' -e 's/", / /g' -e 's/"//g' | \ + sed -E '/'"${LIST_INST::-1}"'[^-]/ s/$/ '"$(echo -e \\033\[1\;35m[ Installed ]\\033\[1\;37m)"'/' } set_variables() { |