From 799512caf181f2f345fa54821bae60869c62b17b Mon Sep 17 00:00:00 2001 From: awalsh128 Date: Mon, 25 Jul 2022 21:02:11 -0700 Subject: [PATCH] Account for packages without deps. --- lib.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib.sh b/lib.sh index 8a21a2a..fbc1c80 100755 --- a/lib.sh +++ b/lib.sh @@ -22,7 +22,11 @@ function get_dep_packages { exit 2 fi done < <(apt-fast install --dry-run --yes "${1}" | grep "^Inst" | grep -v "^Inst ${1} " | sort) - echo "${dep_packages:0:-1}" # Removing trailing space. + if test -n "${dep_packages}"; then + echo "${dep_packages:0:-1}" # Removing trailing space. + else + echo "" + fi } # Split fully qualified package into name and version.