Copied command_exists function to the helpers lib so that there is no hidden dependency on the base plugin

The original command_exists function will stay in the base plugin, but will no longer be used by other plugins or themes.
This commit is contained in:
Nils Winkler
2017-09-15 08:10:17 +02:00
parent 0fe2710c61
commit 145ec5dfaa
10 changed files with 60 additions and 28 deletions

View File

@@ -5,6 +5,15 @@ BASH_IT_LOAD_PRIORITY_DEFAULT_PLUGIN=${BASH_IT_LOAD_PRIORITY_DEFAULT_PLUGIN:-250
BASH_IT_LOAD_PRIORITY_DEFAULT_COMPLETION=${BASH_IT_LOAD_PRIORITY_DEFAULT_COMPLETION:-350}
BASH_IT_LOAD_PRIORITY_SEPARATOR="---"
function _command_exists ()
{
_about 'checks for existence of a command'
_param '1: command to check'
_example '$ _command_exists ls && echo exists'
_group 'lib'
type "$1" &> /dev/null ;
}
# Helper function loading various enable-able files
function _load_bash_it_files() {
subdirectory="$1"