Files
flatpak/tests/make-test-runtime.sh
Simon McVittie 4735e3ea90 tests: Use type -P in preference to which
which(1) is neither standardized by POSIX nor built-in to bash, and has
different implementations and behaviour on different distributions.
command -v is standardized by POSIX, but it won't return the path to an
executable if the same command is available as a shell builtin, so it
isn't necessarily suitable here either.

The Flatpak test suite uses bash scripts rather than POSIX shell scripts,
so we can safely make use of bash-specific options for builtins, and
in particular type -P, which has the semantics we want here: search PATH,
even if there is a shell builtin of the same name.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-01-25 10:07:03 +01:00

2.1 KiB
Executable File