Skip to content

Commit

Permalink
Merge pull request #15 from D630/check-against-existence-of-precmd-fu…
Browse files Browse the repository at this point in the history
…nction

test precmd_function without test compound command and command substitution
  • Loading branch information
rcaloras committed Nov 1, 2015
2 parents b1896c1 + 921a952 commit f4a04f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bash-preexec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ __bp_precmd_invoke_cmd() {

# For every function defined in our function array. Invoke it.
local precmd_function
for precmd_function in ${precmd_functions[@]}; do
for precmd_function in "${precmd_functions[@]}"; do

# Only execute this function if it actually exists.
if [[ -n $(type -t $precmd_function) ]]; then
# Test existence of functions with: declare -[Ff]
if type -t "$precmd_function" 1>/dev/null; then
__bp_set_ret_value $ret_value
$precmd_function
fi
Expand Down

0 comments on commit f4a04f8

Please sign in to comment.