Skip to content
Snippets Groups Projects
Commit 193880c9 authored by nimrod's avatar nimrod
Browse files

s/which/command -v/g (which is missing in some installations).

parent fa9e3519
Branches
No related tags found
No related merge requests found
! which aws_completer >/dev/null || complete -C 'aws_completer' aws
! command -v aws_completer >/dev/null || complete -C 'aws_completer' aws
......@@ -191,7 +191,7 @@ then
do
[ ! -f "$sourcefile" ] || . "$sourcefile"
done
! which direnv > /dev/null || eval $(direnv hook bash)
! command -v direnv > /dev/null || eval $(direnv hook bash)
fi
......
......@@ -6,7 +6,7 @@ die () {
exit 1
}
which ip > /dev/null || die "Can't find ip."
command -v ip > /dev/null || die "Can't find ip."
alias ssh='ssh -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i "$HOME/.ssh/bullguard-box_rsa" -l root -p 64222'
......
#!/bin/sh
set -eu
if ! which dconf > /dev/null
if ! command -v dconf > /dev/null
then
echo "Can't find dconf, exiting."
exit 0
......
#!/bin/sh
set -eu
! which pandoc > /dev/null || pandoc --bash-completion > "$HOME/.bash_completion.d/pandoc"
! which pipenv > /dev/null || pipenv --completion > "$HOME/.bash_completion.d/pipenv"
! command -v pandoc > /dev/null || pandoc --bash-completion > "$HOME/.bash_completion.d/pandoc"
! command -v pipenv > /dev/null || pipenv --completion > "$HOME/.bash_completion.d/pipenv"
#!/bin/sh
set -eu
which pur > /dev/null || { echo "Can't find pur."; exit 1; }
command -v pur > /dev/null || { echo "Can't find pur."; exit 1; }
git stash save --all --include-untracked --quiet
git ls-files '*requirements*.txt' | xargs -n1 pur -r
......
......@@ -60,10 +60,10 @@ else
action="$2"
fi
which curl > /dev/null || die "Can't login to the WiFi network, cURL is not installed."
which awk > /dev/null || die "Can't login to the WiFi network, awk is not installed."
which logger > /dev/null || die "Can't login to the WiFi network, logger is not installed."
which nmcli > /dev/null || die "Can't login to the WiFi network, nmcli is not installed."
command -v curl > /dev/null || die "Can't login to the WiFi network, cURL is not installed."
command -v awk > /dev/null || die "Can't login to the WiFi network, awk is not installed."
command -v logger > /dev/null || die "Can't login to the WiFi network, logger is not installed."
command -v nmcli > /dev/null || die "Can't login to the WiFi network, nmcli is not installed."
echo "$action" | grep -xq 'up\|dhcp4-change\|dhcp6-change\|connectivity-change' || \
die "Can't login to the WiFi network, action $action isn't up nor changed."
......
......@@ -2,8 +2,8 @@
set -eu
basename="$(basename "$0")"
command="$(env -i which "$basename")" || { echo "$basename: not found"; exit 127; }
if alias="$(which "$basename-${1:-}")"
command="$(env -i sh -c "command -v $basename")" || { echo "$basename: not found"; exit 127; }
if alias="$(command -v "$basename-${1:-}")"
then
shift
"$alias" "$@"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment