Permalink
Browse files

Added comments and a sanity check to the trap.

  • Loading branch information...
1 parent 1689dd5 commit c06f33128bc7cffa3c5131b404cd61d4479db386 @wayneeseguin wayneeseguin committed Mar 2, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 scripts/base
View
@@ -44,6 +44,9 @@ done
unset scripts entry rvm_base_except
if [[ ${rvm_interactive_flag} -eq 0 ]]; then
- # Cleanup tmp on exit.
- trap "__rvm_cleanup_tmp '$$'" 0 1 2 3 15
+ # Cleanup RVM temporary files on exit if we are loaded from a script.
+ if command -v __rvm_cleanup_tmp >/dev/null 2>&1 ; then
+ # Only cleanup if the function to do so is defined :)
+ trap "__rvm_cleanup_tmp '$$'" 0 1 2 3 15
+ fi
fi

0 comments on commit c06f331

Please sign in to comment.