Skip to content

Commit 0f04dcf

Browse files
author
noirbizarre
committed
Avoid declaring the 'command_exists' function for a one shot use.
1 parent 0f32d31 commit 0f04dcf

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

virtualenvwrapper.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,6 @@ virtualenvwrapper_show_workon_options () {
291291
# (cd "$WORKON_HOME"; find -L . -depth 3 -path '*/bin/activate') | sed 's|^\./||' | sed 's|/bin/activate||' | sort
292292
}
293293

294-
295-
# test if a given command exists
296-
command_exists () {
297-
command -v "$1" &> /dev/null ;
298-
}
299-
300294
_lsvirtualenv_usage () {
301295
echo "lsvirtualenv [-blh]"
302296
echo " -b -- brief mode"
@@ -310,7 +304,7 @@ _lsvirtualenv_usage () {
310304
lsvirtualenv () {
311305

312306
typeset long_mode=true
313-
if command_exists getopts
307+
if command -v "getopts" &> /dev/null
314308
then
315309
# Use getopts when possible
316310
OPTIND=1

0 commit comments

Comments
 (0)