summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-07-06 22:38:45 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-07-06 22:38:45 -0600
commitf63ad6177a137ccc1c410acca75192d7ca369ecc (patch)
tree233a58357220e1fa1772898f4a89c95dc0508d06
parent700e3cf27dcddac84632bcfed3d27ef36cb43df5 (diff)
handle empty listsHEADmaster
-rwxr-xr-xpackages.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages.sh b/packages.sh
index c79d58c..d685149 100755
--- a/packages.sh
+++ b/packages.sh
@@ -12,8 +12,12 @@ fi
packages_txt() {
{
- pacman -Sgq -- "${grps[@]}"|grep -vFx -f <(printf '%s\n' "${excl[@]}")
- printf '%s\n' "${pkgs[@]}"
+ if [[ ${#grps[@]} -gt 0 ]]; then
+ pacman -Sgq -- "${grps[@]}"|grep -vFx -f <(printf '%s\n' "${excl[@]}")
+ fi
+ if [[ ${#pkgs[@]} -gt 0 ]]; then
+ printf '%s\n' "${pkgs[@]}"
+ fi
} | sort -u
}