diff --git a/automation_tools/install_dependencies.sh b/automation_tools/install_dependencies.sh index 0243fc15..3daa4edb 100755 --- a/automation_tools/install_dependencies.sh +++ b/automation_tools/install_dependencies.sh @@ -1,14 +1,14 @@ #!/bin/bash # This script is installing the required dependencies to correctly run the pipeline and build the flatpak -unset result +unset pkg_mgr # rpm-ostree must be checked before dnf because a dnf (wrapper) command also works on rpm-ostree distros (not what we want) -for pkg_manager in apt pacman rpm-ostree dnf; do - command -v "$pkg_manager" &> /dev/null && result="$pkg_manager" && break +for potential_pkg_mgr in apt pacman rpm-ostree dnf; do + command -v "$potential_pkg_mgr" &> /dev/null && pkg_mgr="$potential_pkg_mgr" && break done -case $result in +case "$pkg_mgr" in apt) sudo apt install -y flatpak flatpak-builder p7zip-full xmlstarlet bzip2 curl jq ;; @@ -23,7 +23,7 @@ case $result in sudo dnf install -y flatpak flatpak-builder p7zip p7zip-plugins xmlstarlet bzip2 curl ;; *) - echo "Package manager $result not supported. Please open an issue." + echo "Package manager $pkg_mgr not supported. Please open an issue." ;; esac