Skip to content

Commit

Permalink
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 committed Aug 28, 2020
1 parent da1ef1a commit f937f89
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions themes/base.theme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,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 @@ -81,7 +80,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 f937f89

Please sign in to comment.