From d46762752cd5a8d8b813cbe3d7939709a640bacb Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Thu, 17 Apr 2025 19:00:51 +0300 Subject: [PATCH] fix run.sh script --- run.sh | 60 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/run.sh b/run.sh index 2e45e3e..b204c76 100755 --- a/run.sh +++ b/run.sh @@ -3,54 +3,54 @@ set -e if [ ! -f "./xmir_base/xmir_init.py" ]; then - echo "ERROR: XMiR: Current working directory not correct!" - exit 1 + echo "ERROR: XMiR: Current working directory not correct!" + exit 1 fi PY3_PATH=`which python3` if [ ! -e "$PY3_PATH" ]; then - echo "ERROR: XMiR: python3 binary not found!" - exit 1 + echo "ERROR: XMiR: python3 binary not found!" + exit 1 fi if [ ! -e "$VIRTUAL_ENV" ] || ! type deactivate &> /dev/null ; then - python3 -m venv venv - if [ ! -e "./venv/bin/activate" ]; then - echo "ERROR: XMiR: python3 venv not initialized!" - exit 1 - fi - source ./venv/bin/activate - PY3_PATH=`which python3` - if [ ! -e "$PY3_PATH" ]; then - echo "ERROR: XMiR: python3 venv binary not found!" - deactivate - exit 1 - fi + python3 -m venv venv + if [ ! -e "./venv/bin/activate" ]; then + echo "ERROR: XMiR: python3 venv not initialized!" + exit 1 + fi + source ./venv/bin/activate + PY3_PATH=`which python3` + if [ ! -e "$PY3_PATH" ]; then + echo "ERROR: XMiR: python3 venv binary not found!" + deactivate + exit 1 + fi fi if [ ! -e "$VIRTUAL_ENV" ] || ! type deactivate &> /dev/null ; then - echo "ERROR: XMiR: python3 venv cannot activate!" - exit 1 + echo "ERROR: XMiR: python3 venv cannot activate!" + exit 1 fi -SSH2_PKG=`find ./venv -type d -wholename '*/site-packages/ssh2_python*' | wc -l | tr -d' '` +SSH2_PKG=`find ./venv -type d -wholename '*/site-packages/ssh2_python*' | wc -l | tr -d ' '` if [ "$SSH2_PKG" = "0" ]; then - # install - python3 -m pip install -r requirements.txt - # check - SSH2_PKG=`find ./venv -type d -wholename '*/site-packages/ssh2_python*' | wc -l | tr -d' '` - if [ "$SSH2_PKG" = "0" ]; then - echo "ERROR: XMiR: python3 package 'ssh2-python' not installed!" - deactivate - exit 1 - fi + # install + python3 -m pip install -r requirements.txt + # check + SSH2_PKG=`find ./venv -type d -wholename '*/site-packages/ssh2_python*' | wc -l | tr -d ' '` + if [ "$SSH2_PKG" = "0" ]; then + echo "ERROR: XMiR: python3 package 'ssh2-python' not installed!" + deactivate + exit 1 + fi fi export PYTHONUNBUFFERED=TRUE if [ "$1" = "" ]; then - python3 menu.py + python3 menu.py else - python3 "$@" + python3 "$@" fi #deactivate