[openwrt/openwrt] scripts/env: Fix 56f813674a scripts/env: use command -v instead of which

LEDE Commits lede-commits at lists.infradead.org
Sun Jul 12 08:30:04 EDT 2020


ldir pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/8242c6de29951fbb549355770cd685ffe3ac9c54

commit 8242c6de29951fbb549355770cd685ffe3ac9c54
Author: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
AuthorDate: Sun Jul 12 13:25:39 2020 +0100

    scripts/env: Fix 56f813674a scripts/env: use command -v instead of which
    
    We don't need to see how git will be executed and it produces non silent
    output on 'scripts/env diff' commands when there are no differences
    unlike before.
    
    Re-introduce original silent behaviour.
    
    Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 scripts/env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/env b/scripts/env
index 726a354b57..df8b486bfe 100755
--- a/scripts/env
+++ b/scripts/env
@@ -57,7 +57,7 @@ env_init() {
 	if [ -z "$CREATE" ]; then
 		[ -d "$ENVDIR" ] || exit 0
 	fi
-	command -v git || error "Git is not installed"
+	command -v git >/dev/null || 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 ] || { 



More information about the lede-commits mailing list