o3de.sh 886 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. #
  3. # Copyright (c) Contributors to the Open 3D Engine Project.
  4. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. #
  6. # SPDX-License-Identifier: Apache-2.0 OR MIT
  7. #
  8. #
  9. #Use $(cd dirname $0) to get the absolute path of this scripts folder
  10. #Note this does not actually change the working directory
  11. SCRIPT_DIR=$(cd `dirname $0` && pwd)
  12. #python should be in the base path
  13. BASE_PATH=$(dirname "$SCRIPT_DIR")
  14. PYTHON_DIRECTORY="$BASE_PATH/python"
  15. #If engine python exists use it, if not try the system python
  16. if [ ! -d "$PYTHON_DIRECTORY" ]; then
  17. PYTHON_EXECUTABLE="python"
  18. else
  19. PYTHON_EXECUTABLE="$PYTHON_DIRECTORY/python.sh"
  20. fi
  21. if [ ! -f "$PYTHON_EXECUTABLE" ]; then
  22. echo "Python executable not found: $PYTHON_EXECUTABLE"
  23. exit 1
  24. fi
  25. #run the o3de.py pass along the command
  26. $PYTHON_EXECUTABLE "$SCRIPT_DIR/o3de.py" $*
  27. exit $?