Skip to content

Commit 01f1b2b

Browse files
committed
use the correct program to determine if a program exists; type -P
We are a bash script, so type -P does precisely what people think they want `which` to do. Except `which` doesn't exist on my system! And in general it is non-portable -- it has many different implementations, some of which don't return failure on failures, and others of which don't actually, erm, check $PATH (looking at you, ~/.cshrc `which`).
1 parent d107c42 commit 01f1b2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

build_win32.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ check_programs() {
2424
local i errors
2525
errors=0
2626
for i in "${REQUIRED[@]}"; do
27-
which $i &> /dev/null || error "Missing program $i"
27+
type -P $i &> /dev/null || error "Missing program $i"
2828
done
2929
exit_on_error
3030
}

0 commit comments

Comments
 (0)