Skip to content

Commit

Permalink
fix(bash): force temporary file deletion
Browse files Browse the repository at this point in the history
forces the temporary file deletion when the user uses a security rm alias
  • Loading branch information
ojullien committed Apr 10, 2021
1 parent b27016d commit 5134e11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/init/omp.bash
Expand Up @@ -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)"

Expand All @@ -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
Expand Down

0 comments on commit 5134e11

Please sign in to comment.