mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 15:36:21 -04:00
This may not be installed on various systems, and it's difficult to test for the availability of the tool you need, if the check program itself does not exist. The POSIX 2008 specification mandates the `command -v` builtin; bash is a POSIX 2008 compliant shell, and this builtin has worked since bash 1.x anyway. A side benefit of using the POSIX portable option is that it requires neither an external disk executable, nor (because unlike "which", the exit code is reliable) a subshell fork. This therefore represents a mild speedup.
11 lines
175 B
Bash
Executable file
11 lines
175 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
err() {
|
|
echo >&2 "$1"
|
|
exit 1
|
|
}
|
|
|
|
if ! command -v column >/dev/null 2>&1; then
|
|
err "Need to install dependency 'column' before installation"
|
|
fi
|