From 5134e11bc62668d5437cbb3ce3a78123e6b5e22e Mon Sep 17 00:00:00 2001 From: Olivier Jullien <3778194+ojullien@users.noreply.github.com> Date: Sat, 10 Apr 2021 07:07:04 +0000 Subject: [PATCH] fix(bash): force temporary file deletion forces the temporary file deletion when the user uses a security rm alias --- src/init/omp.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init/omp.bash b/src/init/omp.bash index 6677bc72..02fd02b8 100644 --- a/src/init/omp.bash +++ b/src/init/omp.bash @@ -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