Bug 1669874 - Use `command -v` instead of `which` in mach. r=firefox-build-system-reviewers,andi,rstewart

The former is a POSIX shell construct, usually a builtin, and the latter
is an external program that is not guaranteed to be available.

When `which` is not available, a full ./mach build succeeds with this
change.

Differential Revision: https://phabricator.services.mozilla.com/D92864
This commit is contained in:
Mike Hommey 2020-10-08 14:58:43 +00:00
Родитель 895372d464
Коммит e469210428
1 изменённых файлов: 1 добавлений и 1 удалений

2
mach
Просмотреть файл

@ -61,7 +61,7 @@ run_py() {
# Try to run a specific Python interpreter.
py_executable="$1"
shift
if which "$py_executable" > /dev/null
if command -v "$py_executable" > /dev/null
then
exec "$py_executable" "$0" "$@"
else