From: Rosen Penev Date: Mon, 6 Jan 2020 02:32:35 +0000 (-0800) Subject: scripts/env: use command -v instead of which X-Git-Tag: v21.02.0-rc1~2243 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=56f813674a;p=openwrt%2Fstaging%2Fhauke.git scripts/env: use command -v instead of which Simpler and built in to the shell. Found with shellcheck. Signed-off-by: Rosen Penev --- diff --git a/scripts/env b/scripts/env index 7bfca58c5d..563f39c1cf 100755 --- a/scripts/env +++ b/scripts/env @@ -57,7 +57,7 @@ env_init() { if [ -z "$CREATE" ]; then [ -d "$ENVDIR" ] || exit 0 fi - [ -x "$(which git 2>/dev/null)" ] || error "Git is not installed" + command -v git || error "Git is not installed" mkdir -p "$ENVDIR" || error "Failed to create the environment directory" cd "$ENVDIR" || error "Failed to switch to the environment directory" [ -d .git ] || {