diff --git a/lib/utilities.bash b/lib/utilities.bash index fa77d4fd..de31810e 100644 --- a/lib/utilities.bash +++ b/lib/utilities.bash @@ -78,7 +78,7 @@ _bash-it-component-help() { if [[ ! -s "${file}" || -z "$(find "${file}" -mmin -300)" ]] ; then rm -f "${file}" 2>/dev/null local func="_bash-it-${component}" - "${func}" | $(_bash-it-grep) -E ' \[' | cat > "${file}" + "${func}" | ${BASH_IT_GREP:-$(_bash-it-grep)} -E ' \[' > "${file}" fi cat "${file}" } @@ -124,17 +124,17 @@ _bash-it-component-list() { _bash-it-component-list-matching() { local component="$1"; shift local term="$1" - _bash-it-component-help "${component}" | $(_bash-it-grep) -E -- "${term}" | awk '{print $1}' | sort -u + _bash-it-component-help "${component}" | ${BASH_IT_GREP:-$(_bash-it-grep)} -E -- "${term}" | awk '{print $1}' | sort -u } _bash-it-component-list-enabled() { local IFS=$'\n' component="$1" - _bash-it-component-help "${component}" | $(_bash-it-grep) -E '\[x\]' | awk '{print $1}' | sort -u + _bash-it-component-help "${component}" | ${BASH_IT_GREP:-$(_bash-it-grep)} -E '\[x\]' | awk '{print $1}' | sort -u } _bash-it-component-list-disabled() { local IFS=$'\n' component="$1" - _bash-it-component-help "${component}" | $(_bash-it-grep) -E -v '\[x\]' | awk '{print $1}' | sort -u + _bash-it-component-help "${component}" | ${BASH_IT_GREP:-$(_bash-it-grep)} -E -v '\[x\]' | awk '{print $1}' | sort -u } # Checks if a given item is enabled for a particular component/file-type. @@ -148,7 +148,7 @@ _bash-it-component-list-disabled() { _bash-it-component-item-is-enabled() { local component="$1" local item="$2" - _bash-it-component-help "${component}" | $(_bash-it-grep) -E '\[x\]' | $(_bash-it-grep) -E -q -- "^${item}\s" + _bash-it-component-help "${component}" | ${BASH_IT_GREP:-$(_bash-it-grep)} -E '\[x\]' | ${BASH_IT_GREP:-$(_bash-it-grep)} -E -q -- "^${item}\s" } # Checks if a given item is disabled for a particular component/file-type. @@ -162,5 +162,5 @@ _bash-it-component-item-is-enabled() { _bash-it-component-item-is-disabled() { local component="$1" local item="$2" - _bash-it-component-help "${component}" | $(_bash-it-grep) -E -v '\[x\]' | $(_bash-it-grep) -E -q -- "^${item}\s" + _bash-it-component-help "${component}" | ${BASH_IT_GREP:-$(_bash-it-grep)} -E -v '\[x\]' | ${BASH_IT_GREP:-$(_bash-it-grep)} -E -q -- "^${item}\s" }