From e53c7a64f6d947232e5d43c5d2074d9365844aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Wed, 10 Aug 2022 13:19:45 +0800 Subject: [PATCH] Clean up after rbash_upgrade --- bash/bashrc/rbashrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bash/bashrc/rbashrc b/bash/bashrc/rbashrc index 5f4ddc1..45cc0c1 100644 --- a/bash/bashrc/rbashrc +++ b/bash/bashrc/rbashrc @@ -171,6 +171,12 @@ function rbash_upgrade { $TMPFILE mv $TMPFILE $__SCRIPT + + # Clean up the old dir + if [ $? -eq 0 ] && [ -d "$BASH_SDIR" ]; then + rm -r "$BASH_SDIR" + fi + . $__SCRIPT }