MQTT Home Emulation
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. #
  3. BASEPATH=`realpath $(dirname $0)`
  4. #
  5. # Create venv
  6. #
  7. if [[ ! -e $BASEPATH/venv ]]; then
  8. python3 -m venv $BASEPATH/venv > /dev/null 2>&1
  9. find $BASEPATH -name requirements.txt | xargs -L 1 $BASEPATH/venv/bin/pip install -r > /dev/null 2>&1
  10. echo "venv changed"
  11. fi
  12. #
  13. # Update venv modules
  14. #
  15. for req_mod in $($BASEPATH/venv/bin/pip list --format=json | jq -r '.[] | .name'); do
  16. $BASEPATH/venv/bin/pip install -U $req_mod | grep install > /dev/null 2>&1
  17. if [[ "$?" -eq "0" ]]; then
  18. echo $req_mod changed
  19. fi
  20. done
  21. #|xargs -n1 $BASEPATH/venv/bin/pip install -U