mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-12 03:37:31 -08:00
fix(bash): force temporary file deletion
forces the temporary file deletion when the user uses a security rm alias
This commit is contained in:
parent
b27016d325
commit
5134e11bc6
|
@ -12,7 +12,7 @@ function _omp_hook() {
|
|||
omp_now=$(::OMP:: --millis)
|
||||
omp_start_time=$(cat "$TIMER_START")
|
||||
omp_elapsed=$((omp_now-omp_start_time))
|
||||
rm "$TIMER_START"
|
||||
rm -f "$TIMER_START"
|
||||
fi
|
||||
PS1="$(::OMP:: --config $POSH_THEME --shell bash --error $ret --execution-time $omp_elapsed)"
|
||||
|
||||
|
@ -24,7 +24,7 @@ if [ "$TERM" != "linux" ] && [ -x "$(command -v ::OMP::)" ] && ! [[ "$PROMPT_COM
|
|||
fi
|
||||
|
||||
function _omp_runonexit() {
|
||||
[[ -f $TIMER_START ]] && rm "$TIMER_START"
|
||||
[[ -f $TIMER_START ]] && rm -f "$TIMER_START"
|
||||
}
|
||||
|
||||
trap _omp_runonexit EXIT
|
||||
|
|
Loading…
Reference in a new issue