diff options
author | Rosen Penev <rosenp@gmail.com> | 2020-01-05 18:32:35 -0800 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2020-07-11 13:33:28 +0200 |
commit | 56f813674a912490df327304033bf667b285930a (patch) | |
tree | 59d90b6ad9278c8760541aa99e3f1b1306b0d7a1 /scripts/env | |
parent | 11192484fa320cd233849441bd00ddf58964de42 (diff) | |
download | upstream-56f813674a912490df327304033bf667b285930a.tar.gz upstream-56f813674a912490df327304033bf667b285930a.tar.bz2 upstream-56f813674a912490df327304033bf667b285930a.zip |
scripts/env: use command -v instead of which
Simpler and built in to the shell.
Found with shellcheck.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'scripts/env')
-rwxr-xr-x | scripts/env | 2 |
1 files changed, 1 insertions, 1 deletions
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 ] || { |