Make more resilient
This commit is contained in:
1 parent
1a630b1239
commit
bffc8f1fae
1 file changed
+7
-2
@@ -5,9 +5,14 @@
|
|||||||
# omarchy:requires-sudo=true
|
# omarchy:requires-sudo=true
|
||||||
|
|
||||||
installed=()
|
installed=()
|
||||||
|
declare -A seen=()
|
||||||
for pkg in "$@"; do
|
for pkg in "$@"; do
|
||||||
if pacman -Q "$pkg" &>/dev/null; then
|
if package_info=$(pacman -Q "$pkg" 2>/dev/null); then
|
||||||
installed+=("$pkg")
|
package_name=${package_info%% *}
|
||||||
|
if [[ -z ${seen[$package_name]} ]]; then
|
||||||
|
installed+=("$package_name")
|
||||||
|
seen[$package_name]=1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user