From ac6f7ee1814b24f0e0d910865ed6e75a14f2c2b4 Mon Sep 17 00:00:00 2001 From: Erwin Jansen Date: Fri, 28 Aug 2020 13:32:19 -0700 Subject: [PATCH] lib/omb-prompt-base: Fix timeout bug Run with timeout should function correctly if no timeout command is available. --- lib/omb-prompt-base.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/omb-prompt-base.sh b/lib/omb-prompt-base.sh index 47796d2de..0c6d7dab7 100644 --- a/lib/omb-prompt-base.sh +++ b/lib/omb-prompt-base.sh @@ -36,7 +36,6 @@ SCM_GIT_SHOW_CURRENT_USER=${SCM_GIT_SHOW_CURRENT_USER:=false} SCM_GIT_SHOW_MINIMAL_INFO=${SCM_GIT_SHOW_MINIMAL_INFO:=false} SCM_GIT='git' - SCM_GIT_CHAR='±' SCM_GIT_DETACHED_CHAR='⌿' SCM_GIT_AHEAD_CHAR="↑" @@ -124,7 +123,11 @@ function run_with_timeout() { TIMEOUT=gtimeout fi - $TIMEOUT ${TIME} ${CMD} + if [ -z "$TIMEOUT" ]; then + ${CMD} + else + $TIMEOUT ${TIME} ${CMD} + fi } function scm {