Fix detection of having no packages
Sometimes empty elements containing only spaces are pushed in to the packages array, before the code would only detect that there are no pacakges to install when only one spaces was inserted, now it should work for any arbitrary count of elements containing only spaces.
This commit is contained in:
parent
7f35cdc86a
commit
45d4b8bad6
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ done < <(echo "$package_list" | tail -n+$((table_start+2)))
|
|||
|
||||
unneeded_package_list=$(printf '%s ' "${unneeded_packages[@]}")
|
||||
|
||||
if [ ! "$unneeded_package_list" = " " ]; then
|
||||
if [ -n "$(echo $unneeded_package_list | tr -d ' ')" ]; then
|
||||
sudo zypper rm -u $unneeded_package_list
|
||||
else
|
||||
echo "No unneeded packages."
|
||||
|
|
Loading…
Reference in a new issue