diff options
author | Ben Busby <benbusby@protonmail.com> | 2021-02-23 14:00:42 -0500 |
---|---|---|
committer | Ben Busby <benbusby@protonmail.com> | 2021-02-23 14:00:42 -0500 |
commit | 3e96fdab92b01e3e9891e4628be7b47a3bf92336 (patch) | |
tree | 964f7060d5eb2894ba441f968c55b133b58069c2 | |
parent | 7b8501bdf41c97dfadffed8e714f86e2e7a2f7cd (diff) |
Use separate mapping for distro install commands
On Arch Linux, pacman doesn't follow the same conventions as "apt-get"
and "yum", so the install script failed at the dependencies stage. This
introduces a new mapping of "package manager -> install command" to
improve cross distro support (and to fix the script for Arch builds).
-rwxr-xr-x | install.linux.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/install.linux.sh b/install.linux.sh index 5ae646f..737bb94 100755 --- a/install.linux.sh +++ b/install.linux.sh @@ -31,8 +31,15 @@ declare -A packageAA=( libusb ' ) + +declare -A commandAA=( + ['apt-get']='install -y' + ['yum']='install -y' + ['pacman']='--noconfirm -S' +) + for key in ${!packageAA[@]}; do - which $key && sudo $key install -y ${packageAA[$key]} + which $key && sudo $key ${commandAA[$key]} ${packageAA[$key]} done # WALLY UDEV RULE FOR DEVICE RELATED EVENT |