forked from pytorch/executorch
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_python_script.sh
More file actions
Latest commit
executable file
·26 lines (22 loc) · 744 Bytes
/
Copy pathrun_python_script.sh
File metadata and controls
executable file
·26 lines (22 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
# Before doing anything, cd to the directory containing this script.
cd -- "$( dirname -- "${BASH_SOURCE[0]}")"&> /dev/null || /bin/true
# Find the names of the python tools to use.
if [[ -z$PYTHON_EXECUTABLE ]];
then
if [[ -z$CONDA_DEFAULT_ENV ]] || [[ $CONDA_DEFAULT_ENV=="base" ]] || [[ !-x"$(command -v python)" ]];
then
PYTHON_EXECUTABLE=python3
else
PYTHON_EXECUTABLE=python
fi
fi
SCRIPT="$1";shift
$PYTHON_EXECUTABLE$SCRIPT"$@"
# Exit with the same status as the python script.
exit$?