Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. install_requirements() {
  2.     module_requirements="$1"
  3.    
  4.     #printf "pip3 -qqq install -r $module_requirements"
  5.     pip3 -qqq install -r $module_requirements
  6.    
  7.     return_code=$?
  8.     if [ $return_code != 0 ]; then
  9.         printf "${RED}Error:[%d]. Try running it with root privilages\n" $return_code
  10.         exit $return_code
  11.     fi
  12. }
  13.  
  14. install_forked_yowsup() {
  15.     printf "Installing ${ORANGE}yowsup libraries${NC}\n"
  16.     printf "${NC}--------------------------\n"
  17.     cd libs/python-axolotl
  18.     python3 setup.py -qqq install
  19.     wait
  20.     cd ../yowsup
  21.     python3 setup.py -qqq install
  22.     wait
  23.     printf "${NC}--------------------------\n"
  24.     # Return to root
  25.     cd ../../
  26. }
  27.  
  28. install_modules() {
  29.     printf "Configuring modules\n"
  30.     printf "${NC}--------------------------\n"
  31.     cd modules
  32.     for D in *; do
  33.         if [ -d "${D}" ] && [ "${D}" != "__pycache__" ]; then
  34.             if [ -f ${D}/requirements.txt ]; then
  35.                 printf "[${CYAN}${D}${NC}] Installing dependencies...\n"
  36.                 module_requirements="${D}/requirements.txt"
  37.                 install_requirements "$module_requirements"
  38.             else
  39.                 printf "[${CYAN}${D}${NC}] All good...\n"
  40.             fi
  41.         fi
  42.     done
  43.     wait
  44.    
  45.     printf "${NC}--------------------------\n"
  46.    
  47.     # Return to root
  48.     cd ../
  49. }
  50.  
  51. install_app_dependencies() {
  52.     printf "Configuring framework\n"
  53.     printf "${NC}--------------------------\n"
  54.     printf "[${CYAN}mac${NC}] Installing dependencies...\n"
  55.    
  56.     app_requirements="app/requirements.txt"
  57.     install_requirements "$app_requirements"
  58.     wait
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement