use command -v instead of which

which is a non-standard command, whereas command is part of posix

Signed-off-by: Leah Rowe <leah@libreboot.org>
20241206_branch
Leah Rowe 2024-12-30 19:23:27 +00:00
parent 6c7e3ce2d6
commit 0c81074746
2 changed files with 3 additions and 3 deletions

2
build
View File

@ -25,7 +25,7 @@ main()
spath="script/$1"; shcmd="shift 1"
[ "${1#-*}" != "$1" ] && spath="script/trees" && shcmd=":"
for g in "which git" "git config --global user.name" \
for g in "command -v git" "git config --global user.name" \
"git config --global user.email" "git_init"; do
eval "$g 1>/dev/null 2>/dev/null || $err \"Unconfigured: $g\""
done

View File

@ -16,8 +16,8 @@ err="err_"
pyver="2"
python="python3"
which python3 1>/dev/null || python="python"
which $python 1>/dev/null || pyver=""
command -v python3 1>/dev/null || python="python"
command -v $python 1>/dev/null || pyver=""
[ -n "$pyver" ] && pyver="$($python --version | awk '{print $2}')"
if [ "${pyver%%.*}" != "3" ]; then
printf "Wrong python version, or python missing. Must be v 3.x.\n" 1>&2