Fix linting issues in scripts

This commit is contained in:
Ohad Livne 2025-06-04 22:46:01 +03:00
parent e3d5f15c00
commit c4952aad8f
Signed by: libohad-dev
GPG key ID: 34FDC68B51191A4D
7 changed files with 17 additions and 13 deletions

View file

@ -5,17 +5,17 @@ WATCHLIST=~/.local/share/package-alert/watchlist
agg_results=""
if [ -f "${WATCHLIST}" ]; then
for pattern in $(cat "${WATCHLIST}"); do
while read -r pattern; do
pat_results=$(apt-cache search --names-only "${pattern}")
if [ ! -z "${pat_results}" ]; then
if [ -n "${pat_results}" ]; then
agg_results="${agg_results:+${agg_results}
}Packages matching \"${pattern}\":
${pat_results}
"
fi
done
done < "${WATCHLIST}"
fi
if [ ! -z "${agg_results}" ]; then
if [ -n "${agg_results}" ]; then
printf '%s' "${agg_results}" | /usr/sbin/sendmail "${USER}"
fi