From 6aa2ad05b97738b17a4cddd0b670ed45138a54d2 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 2 Feb 2024 20:11:54 +0100 Subject: [PATCH] update --- tools/jaklis/requirements.txt | 6 ++---- tools/jaklis/setup.sh | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/tools/jaklis/requirements.txt b/tools/jaklis/requirements.txt index 42eb12b3..c768b70c 100755 --- a/tools/jaklis/requirements.txt +++ b/tools/jaklis/requirements.txt @@ -1,10 +1,8 @@ wheel base58 pybase64 -duniterpy==0.62.0 +duniterpy termcolor python-dotenv -gql==3.0.0a5 -#gql==2.0 +gql requests -websockets==10.0 diff --git a/tools/jaklis/setup.sh b/tools/jaklis/setup.sh index 4a03deb9..7c8397ac 100755 --- a/tools/jaklis/setup.sh +++ b/tools/jaklis/setup.sh @@ -1,8 +1,8 @@ #!/bin/bash -MY_PATH="`dirname \"$0\"`" # relative -MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized -for i in gcc python3-pip python3-setuptools libpq-dev python3-dev python3-wheel python3-duniterpy python3-termcolor ; do +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 @@ -10,11 +10,12 @@ for i in gcc python3-pip python3-setuptools libpq-dev python3-dev python3-wheel fi done -python -m pip install -r requirements.txt +pip3 install -r requirements.txt || hasError=1 +chmod u+x jaklis.py +sudo ln -sf $(realpath jaklis.py) /usr/local/bin/jaklis || hasError=1 -## INSTALL SYSTEM WIDE -mkdir -p ~/.local/bin/ - -cp ${MY_PATH}/jaklis.py ~/.local/bin/jaklis -cp ${MY_PATH}/.env ~/.local/bin/ -chmod u+x ~/.local/bin/jaklis +if [[ hasError -eq 0 ]]; then + echo "Setup done. You can use 'jaklis' command, try it." +else + echo "An error has occurred" +fi