fix: exit code always equal 0

The exit code was not captured correctly since the move to the new bootstrap system.  
It never displays the actual exit code.
This commit is contained in:
Laurent Nullens 2020-12-31 11:31:12 +01:00 committed by Jan De Dobbeleer
parent 4c771d3e15
commit 1bc52c3c48

View file

@ -5,15 +5,17 @@ function omp_preexec() {
}
function omp_precmd() {
omp_last_error=$?
omp_elapsed=-1
if [ $omp_start_time ]; then
omp_now=$(::OMP:: --millis)
omp_elapsed=$(($omp_now-$omp_start_time))
fi
eval "$(::OMP:: --config $POSH_THEME --error $? --execution-time $omp_elapsed --eval)"
eval "$(::OMP:: --config $POSH_THEME --error $omp_last_error --execution-time $omp_elapsed --eval)"
unset omp_start_time
unset omp_now
unset omp_elapsed
unset omp_last_error
}
function install_omp_hooks() {