Long lines are evil, make them short

This commit is contained in:
2014-03-19 23:28:22 +00:00
parent 13a571b9a3
commit ce67b6c3a5

View File

@@ -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"