mirror of
https://github.com/notwa/rc
synced 2024-11-05 00:19:02 -08:00
20 lines
412 B
Bash
Executable file
20 lines
412 B
Bash
Executable file
#!/usr/bin/env sh
|
|
# YES_ZSH
|
|
# YES_BASH
|
|
# YES_DASH
|
|
# YES_ASH
|
|
|
|
has() { ### @-
|
|
### print the result of `which` if the program is found, else simply return 1.
|
|
###
|
|
### ```
|
|
### export CC="$(has clang || has clang-3.8 || has gcc)"
|
|
### ```
|
|
if [ -n "$ZSH_VERSION" ]; then
|
|
whence -p "$1"
|
|
else
|
|
which "$1" >/dev/null 2>&1 && which "$1"
|
|
fi
|
|
}
|
|
|
|
[ -n "${preload+-}" ] || has "$@"
|