2020-04-15 20:27:21 +03:00
|
|
|
#!/bin/sh
|
|
|
|
# Copyright 2020 The Emscripten Authors. All rights reserved.
|
|
|
|
# Emscripten is available under two separate licenses, the MIT license and the
|
|
|
|
# University of Illinois/NCSA Open Source License. Both these licenses can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
#
|
|
|
|
# Entry point for running python scripts on UNIX systems.
|
|
|
|
#
|
2020-05-01 03:30:04 +03:00
|
|
|
# To modify this file, edit `tools/run_python.sh` and then run
|
2020-04-15 20:27:21 +03:00
|
|
|
# `tools/create_entry_points.py`
|
|
|
|
|
2020-05-01 03:30:04 +03:00
|
|
|
if [ -z "$PYTHON" ]; then
|
2020-04-15 20:27:21 +03:00
|
|
|
PYTHON=$(which python3 2> /dev/null)
|
|
|
|
fi
|
|
|
|
|
2020-05-01 03:30:04 +03:00
|
|
|
if [ -z "$PYTHON" ]; then
|
2020-04-15 20:27:21 +03:00
|
|
|
PYTHON=$(which python 2> /dev/null)
|
|
|
|
fi
|
|
|
|
|
2020-05-01 03:30:04 +03:00
|
|
|
if [ -z "$PYTHON" ]; then
|
2020-04-15 20:27:21 +03:00
|
|
|
PYTHON=$(which python2 2> /dev/null)
|
|
|
|
fi
|
|
|
|
|
2020-05-01 03:30:04 +03:00
|
|
|
if [ -z "$PYTHON" ]; then
|
2020-06-16 18:47:13 +03:00
|
|
|
echo 'unable to find python in $PATH'
|
2020-04-15 20:27:21 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-05-01 03:30:04 +03:00
|
|
|
exec "$PYTHON" "$0.py" "$@"
|