From 39d6488c6be8fc3e5c082fd85351b1c36f9247c1 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Thu, 9 Sep 2021 16:17:00 -0700 Subject: [PATCH] plugins/base: use `_command_exists` Addresses bash-it/bash-it#1632 --- plugins/available/base.plugin.bash | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/available/base.plugin.bash b/plugins/available/base.plugin.bash index 8499a2df..b0899ce9 100644 --- a/plugins/available/base.plugin.bash +++ b/plugins/available/base.plugin.bash @@ -5,10 +5,10 @@ function ips () { about 'display all ip addresses for this host' group 'base' - if command -v ifconfig &>/dev/null + if _command_exists ifconfig then ifconfig | awk '/inet /{ gsub(/addr:/, ""); print $2 }' - elif command -v ip &>/dev/null + elif _command_exists ip then ip addr | grep -oP 'inet \K[\d.]+' else @@ -70,7 +70,7 @@ function passgen () # Create alias pass to passgen when pass isn't installed or # BASH_IT_LEGACY_PASS is true. -if ! command -v pass &>/dev/null || [[ "${BASH_IT_LEGACY_PASS:-}" = true ]] +if ! _command_exists pass || [[ "${BASH_IT_LEGACY_PASS:-}" = true ]] then alias pass=passgen fi @@ -81,7 +81,7 @@ function pmdown () param '1: markdown file' example '$ pmdown README.md' group 'base' - if command -v markdown &>/dev/null + if _command_exists markdown then markdown $1 | browser else