fix(bash): force temporary file deletion

forces the temporary file deletion when the user uses a security rm alias
This commit is contained in:
Olivier Jullien 2021-04-10 07:07:04 +00:00 committed by GitHub
parent b27016d325
commit 5134e11bc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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