Use a POSIX compatible built-in to detect the presence of flatpak-spawn

... because it's both faster and more portable than which(1). Detected
by https://www.shellcheck.net/.

Note that the checkbashisms [1] tool thinks that only 'command -p ...'
is specified in POSIX, but that's not true [2].

[1] https://packages.debian.org/sid/devscripts
[2] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
This commit is contained in:
Debarshi Ray 2019-03-12 12:19:16 +01:00
parent 0152317522
commit 6a5b41835e

View file

@ -1006,7 +1006,7 @@ while has_prefix "$1" -; do
done
if [ -f /run/.containerenv ] 2>&3; then
if ! which flatpak-spawn >/dev/null 2>&3; then
if ! command -v flatpak-spawn >/dev/null 2>&3; then
echo "$base_toolbox_command: flatpak-spawn not found" >&2
exit 1
fi