From 223d5dfb8eabf926478e29943856e3704c7d083a 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: Mon, 15 Aug 2022 19:52:12 +0800 Subject: [PATCH] Added rbash-reload --- bash/bashrc/rbashrc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bash/bashrc/rbashrc b/bash/bashrc/rbashrc index 54d7bab..31dd300 100644 --- a/bash/bashrc/rbashrc +++ b/bash/bashrc/rbashrc @@ -137,12 +137,24 @@ function rbash_load { echo "Load: $1" f=`rbash_cache "$RBASH_REMOTE/$RBASH_REPO/raw/branch/master/$RBASH_PATH/$1"` source "$f" + if [ $? -eq 0 ]; then + echo "echo \"Load: $1\"" >> "$RBASH_MERGED" + cat "$f" >> "$RBASH_SOURCES/merged" + else + echo "echo \"Skipped: $1\". Use rbash-reload to try load this again." >> "$RBASH_MERGED" + fi - echo "echo \"Load: $1\"" >> "$RBASH_MERGED" - cat "$f" >> "$RBASH_SOURCES/merged" chmod 700 "$RBASH_MERGED" } +function rbash-reload { + _RBASH_LOADED= + _RBASH_MERGE_START=1 + rm -f "$RBASH_SOURCES/merged" + source "$RBASH_CONFIG" + _RBASH_MERGE_START= +} + function rbash-upgrade { echo "Updating $__SCRIPT"