From 370776b7f3599ad62f6bce07c1f0f9743324fd21 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 31 Jul 2021 14:11:05 +0800 Subject: [PATCH] scripts/build_utils: check retval of "command" instead of checking the output of `command`, check its retval. this is a more idiomatic way of using this tool. and redirect its output to /dev/null. no news is good news. Signed-off-by: Kefu Chai --- scripts/build_utils.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index 5eb7c51a..3512c85c 100644 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -102,9 +102,9 @@ create_virtualenv () { if [ -d $path ]; then echo "Will reuse existing virtual env: $path" else - if [ $(command -v python3) ]; then + if command -v python3 > /dev/null; then virtualenv -p python3 $path - elif [ $(command -v python2.7) ]; then + elif command -v python2.7 > /dev/null; then virtualenv -p python2.7 $path else virtualenv -p python $path -- 2.47.3