From ce67b6c3a52790878d0e88a3029a64282185f072 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Wed, 19 Mar 2014 23:28:22 +0000 Subject: [PATCH] Long lines are evil, make them short --- stub.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stub.sh b/stub.sh index 0ebef48..0be682e 100644 --- a/stub.sh +++ b/stub.sh @@ -209,7 +209,8 @@ restore() { # If stub was for a function, restore the original function. if type "non_stubbed_${cmd}" &>/dev/null; then - if [[ "$(type "non_stubbed_${cmd}" | head -1)" == *"is a function" ]]; then + local original_type="$(type "non_stubbed_${cmd}" | head -1)" + if [[ "$original_type" == *"is a function" ]]; then local source="$(type "non_stubbed_$cmd" | tail -n +2)" source="${source/non_stubbed_${cmd}/$cmd}" eval "$source"