Make more resilient
This commit is contained in:
@@ -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