Skip to content

Instantly share code, notes, and snippets.

@gregtatum
Created May 13, 2020 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregtatum/ba74d8cb822d3b6a25c78e0ebdd0b5b2 to your computer and use it in GitHub Desktop.
Save gregtatum/ba74d8cb822d3b6a25c78e0ebdd0b5b2 to your computer and use it in GitHub Desktop.
diff --git a/mach b/mach
--- a/mach
+++ b/mach
@@ -83,19 +83,19 @@ py2commands="
run_py() {
# Try to run a specific Python interpreter. Fall back to the system
# default Python if the specific interpreter couldn't be found.
py_executable="$1"
shift
if which "$py_executable" > /dev/null
then
- exec "$py_executable" "$0" "$@"
+ exec "$py_executable" -m cProfile -s cumulative "$0" "$@"
elif [ "$py_executable" = "python2.7" ]; then
- exec python "$0" "$@"
+ exec python -m cProfile -s cumulative "$0" "$@"
else
echo "This mach command requires $py_executable, which wasn't found on the system!"
exit 1
fi
}
first_arg=$1
if [ "$first_arg" = "help" ]; then
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment