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 <kchai@redhat.com>
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