From 677346d3cc7cff156f2028d92f86326b1abb981e 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: Fri, 12 Aug 2022 00:07:57 +0800 Subject: [PATCH] Fix upgrade not working properly --- bash/bashrc/rbashrc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bash/bashrc/rbashrc b/bash/bashrc/rbashrc index 1b04be6..180ad78 100644 --- a/bash/bashrc/rbashrc +++ b/bash/bashrc/rbashrc @@ -112,10 +112,14 @@ function rbash_cache { } _RBASH_LOADED= +if [ ! -d "$RBASH_SOURCES" ]; then + _RBASH_MERGE_START=1 +fi + function rbash_load { local f path - if [ -z "$_RBASH_UPGRADE" ]; then + if [ -z "$_RBASH_MERGE_START" ]; then if [ -n "$_RBASH_LOADED" ]; then return 0 fi @@ -173,9 +177,7 @@ function rbash-upgrade { rm -r "$RBASH_SOURCES" fi - _RBASH_UPGRADE=1 source $__SCRIPT - unset _RBASH_UPGRADE } function rbash-run { @@ -286,6 +288,7 @@ rbash_load "sources/40_go-command" rbash_load "sources/41_pivot-command" ___DEFAULT___ chmod 600 "$RBASH_CONFIG" + unset _RBASH_MERGE_START fi source "$RBASH_CONFIG"