Skip to content

Commit

Permalink
lib/omb-prompt-base: Fix timeout bug
Browse files Browse the repository at this point in the history
Run with timeout should function correctly if no timeout command is
available.
  • Loading branch information
Erwin Jansen authored and akinomyoga committed Oct 14, 2023
1 parent 70602c7 commit ac6f7ee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/omb-prompt-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ac6f7ee

Please sign in to comment.