add yum / apt package manager detection

This commit is contained in:
yggverse 2024-07-14 11:28:31 +03:00
parent ea13127100
commit c1afa554b4

View file

@ -25,9 +25,20 @@ until [[ $INSTALL_SYSTEM_DEPENDENCIES =~ (y|n) ]]; do
read -rp "Install system dependencies? [y/n]: " -e INSTALL_SYSTEM_DEPENDENCIES
done
## @TODO check for package manager support
## Dependencies installation requested
if [[ $INSTALL_SYSTEM_DEPENDENCIES == "y" ]]; then
sudo apt install libpq-dev\
### Detect package manager
if [[ ! -z $(which apt) ]]; then
CMD_INSTALL="apt install"
elif [[ ! -z $(which yum) ]]; then
CMD_INSTALL="yum install"
else
echo "Package manager not supported!" && exit
fi
### Install dependencies
sudo $CMD_INSTALL libpq-dev\
bison\
libreadline-dev\
git\