root.sh 791 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. # Define log file location
  3. logFile="$(dirname "$0")/output.log"
  4. # Start logging
  5. exec > >(tee -i "$logFile") 2>&1
  6. "$(dirname "$0")/init_mamba.sh"
  7. if [ $? -ne 0 ]; then
  8. echo "Failed to init mamba, exiting..."
  9. exit 1
  10. fi
  11. export MICROMAMBA_ROOT_PREFIX="./installer_files/mamba"
  12. export MICROMAMBA_EXE="./installer_files/mamba/micromamba"
  13. export SCRIPTS_DIR_MAMBA="./$(dirname "$0")"
  14. $MICROMAMBA_EXE run -p ./installer_files/env node "$SCRIPTS_DIR_MAMBA/init_app.js"
  15. if [ $? -ne 0 ]; then
  16. echo "Failed to init the app, exiting..."
  17. exit 1
  18. fi
  19. $MICROMAMBA_EXE run -p ./installer_files/env python server.py
  20. if [ $? -ne 0 ]; then
  21. echo "Failed to start the app, exiting..."
  22. exit 1
  23. fi
  24. # Stop logging (automatically handled when the script ends)
  25. exec &>/dev/tty