Parcourir la source

scripts/env: use command -v instead of which

Simpler and built in to the shell.

Found with shellcheck.

Signed-off-by: Rosen Penev <[email protected]>
Rosen Penev il y a 5 ans
Parent
commit
56f813674a
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      scripts/env

+ 1 - 1
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 ] || {