You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
906 B
Bash
34 lines
906 B
Bash
#!/bin/bash
|
|
|
|
# Copyright (c) Contributors to the Open 3D Engine Project
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
#
|
|
|
|
SOURCE="${BASH_SOURCE[0]}"
|
|
# While $SOURCE is a symlink, resolve it
|
|
while [[ -h "$SOURCE" ]]; do
|
|
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
|
SOURCE="$( readlink "$SOURCE" )"
|
|
# If $SOURCE was a relative symlink (so no "/" as prefix, need to resolve it relative to the symlink base directory
|
|
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
|
|
done
|
|
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
|
|
|
if [[ "$OSTYPE" = *"darwin"* ]];
|
|
then
|
|
PYTHON=$DIR/runtime/python-3.7.10-rev1-darwin/Python.framework/Versions/3.7/bin/python3
|
|
else
|
|
PYTHON=$DIR/runtime/python-3.7.10-rev2-linux/python/bin/python
|
|
fi
|
|
|
|
if [[ -e "$PYTHON" ]];
|
|
then
|
|
PYTHONNOUSERSITE=1 "$PYTHON" "$@"
|
|
exit $?
|
|
fi
|
|
|
|
echo "Python not found in $DIR"
|
|
echo "Try running $DIR/get_python.sh first."
|
|
exit 1
|