mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-21 06:33:41 +00:00
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>
This commit is contained in:
parent
11192484fa
commit
56f813674a
@ -57,7 +57,7 @@ env_init() {
|
|||||||
if [ -z "$CREATE" ]; then
|
if [ -z "$CREATE" ]; then
|
||||||
[ -d "$ENVDIR" ] || exit 0
|
[ -d "$ENVDIR" ] || exit 0
|
||||||
fi
|
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"
|
mkdir -p "$ENVDIR" || error "Failed to create the environment directory"
|
||||||
cd "$ENVDIR" || error "Failed to switch to the environment directory"
|
cd "$ENVDIR" || error "Failed to switch to the environment directory"
|
||||||
[ -d .git ] || {
|
[ -d .git ] || {
|
||||||
|
Loading…
Reference in New Issue
Block a user