Update hacking env_setup to prefer Python 3 (#75213)

* env_setup - Prefer Python3

Prefer the 'python3' executable over 'python'.

* Add shebang for syntax detection

While the script isn't executable and we recommend sourcing it, having a shebang allows
variuos text editors to detect that it is a shell script and apply proper syntax highlighting.
This commit is contained in:
Sam Doran
2021-07-08 15:14:34 -04:00
committed by GitHub
parent 3ba2243ba3
commit 93e72c96f0
2 changed files with 5 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
#!/bin/sh
# usage: source hacking/env-setup [-q]
# modifies environment for running Ansible from checkout
@@ -22,7 +22,7 @@ prepend_path()
PYTHONPATH=${PYTHONPATH-""}
PATH=${PATH-""}
MANPATH=${MANPATH-$(manpath)}
PYTHON=$(command -v python || command -v python3)
PYTHON=$(command -v python3 || command -v python)
PYTHON_BIN=${PYTHON_BIN-$PYTHON}
verbosity=${1-info} # Defaults to `info' if unspecified