File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,14 @@ function _command_exists ()
2525 _param ' 2: (optional) log message to include when command not found'
2626 _example ' $ _command_exists ls && echo exists'
2727 _group ' lib'
28- local msg=" ${2:- Command ' $1' does not exist! } "
29- type " $1 " & > /dev/null || (_log_warning " $msg " && return 1) ;
28+ local msg=" ${2:- Command ' $1' does not exist\! } "
29+ if type " $1 " & > /dev/null
30+ then
31+ return " $? "
32+ else
33+ _log_debug " $msg "
34+ return 1
35+ fi
3036}
3137
3238function _binary_exists ()
@@ -36,8 +42,14 @@ function _binary_exists ()
3642 _param ' 2: (optional) log message to include when binary not found'
3743 _example ' $ _binary_exists ls && echo exists'
3844 _group ' lib'
39- local msg=" ${2:- Binary ' $1' does not exist! } "
40- type -P " $1 " & > /dev/null || (_log_warning " $msg " && return 1) ;
45+ local msg=" ${2:- Binary ' $1' does not exist\! } "
46+ if type -P " $1 " & > /dev/null
47+ then
48+ return " $? "
49+ else
50+ _log_debug " $msg "
51+ return 1
52+ fi
4153}
4254
4355function _completion_exists ()
You can’t perform that action at this time.
0 commit comments