diff --git a/completions/docker-compose.completion.sh b/completions/docker-compose.completion.sh index 8efbeea..be58a51 100644 --- a/completions/docker-compose.completion.sh +++ b/completions/docker-compose.completion.sh @@ -39,7 +39,7 @@ __docker_compose_to_extglob() { # suppress trailing whitespace __docker_compose_nospace() { # compopt is not available in ancient bash versions - type compopt &>/dev/null && compopt -o nospace + _omb_util_command_exists compopt && compopt -o nospace } # Extracts all service names from the compose file. diff --git a/completions/docker.completion.sh b/completions/docker.completion.sh index 95a464b..c14c600 100644 --- a/completions/docker.completion.sh +++ b/completions/docker.completion.sh @@ -406,7 +406,7 @@ __docker_subcommands() { # suppress trailing whitespace __docker_nospace() { # compopt is not available in ancient bash versions - type compopt &>/dev/null && compopt -o nospace + _omb_util_command_exists compopt && compopt -o nospace } __docker_complete_resolved_hostname() { diff --git a/lib/base.sh b/lib/base.sh index b7efca6..1a14cc4 100644 --- a/lib/base.sh +++ b/lib/base.sh @@ -124,7 +124,7 @@ zipf () { zip -r "$1".zip "$1" ; } # zipf: To create a ZIP arc # mkiso: creates iso from current dir in the parent dir (unless defined) # --------------------------------------------------------- mkiso () { - if type "mkisofs" > /dev/null; then + if _omb_util_command_exists mkisofs; then if [ -z ${1+x} ]; then local isoname=${PWD##*/} else diff --git a/lib/utils.sh b/lib/utils.sh index 9e8750c..b6e8c77 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -403,7 +403,7 @@ _omb_util_alias() { function _omb_util_mktemp { local template=tmp.oh-my-bash.XXXXXXXXXX - if type -t mktemp &>/dev/null; then + if _omb_util_command_exists mktemp; then mktemp -t "$template" else m4 -D template="${TMPDIR:-/tmp}/$template" <<< 'mkstemp(template)' diff --git a/plugins/nvm/nvm.plugin.sh b/plugins/nvm/nvm.plugin.sh index 9cb7c49..068ce1d 100644 --- a/plugins/nvm/nvm.plugin.sh +++ b/plugins/nvm/nvm.plugin.sh @@ -5,7 +5,7 @@ # Try to load nvm only if command not already available -if ! type "nvm" &> /dev/null; then +if ! _omb_util_command_exists nvm; then [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm # This is done as part of completions!!! # [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion