From b8c84c812650d76e8871a40e7e5051bb5f894553 Mon Sep 17 00:00:00 2001 From: ManUtopiK Date: Wed, 7 Dec 2022 19:11:37 +0100 Subject: [PATCH] Prevent apt install on other distro on setup --- setup.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/setup.sh b/setup.sh index 0c9a850..deea56d 100755 --- a/setup.sh +++ b/setup.sh @@ -2,13 +2,17 @@ hasError=0 -for i in gcc python3-pip python3-setuptools libpq-dev python3-dev python3-wheel; do - if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then - [[ ! $j ]] && sudo apt update - sudo apt install -y $i - j=1 - fi -done +if [ -f "/etc/arch-release" ]; then + echo '! jaklis needs gcc python3-pip python3-setuptools libpq-dev python3-dev python3-wheel' +elif [ -f "/etc/lsb-release" ]; then # ubuntu + for i in gcc python3-pip python3-setuptools libpq-dev python3-dev python3-wheel; do + if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then + [[ ! $j ]] && sudo apt update + sudo apt install -y $i + j=1 + fi + done +fi pip3 install -r requirements.txt || hasError=1 chmod u+x jaklis.py