From 03d13f95e37b587c401446827f9f237cbe0f7775 Mon Sep 17 00:00:00 2001 From: Joao C Costa Date: Mon, 14 Dec 2020 08:50:12 +0000 Subject: [PATCH 1/2] Fixing run_once as per mhmurray https://github.com/josephwecker/bashrc_dispatch/issues/1 --- bashrc_dispatch | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bashrc_dispatch b/bashrc_dispatch index bd3e15e..7eadd4e 100644 --- a/bashrc_dispatch +++ b/bashrc_dispatch @@ -66,7 +66,11 @@ fi # Now dispatch special files PRF="${HOME}/." -[ -f "${PRF}bashrc_once" ] && [ -z "$BRCD_RANONCE" ] && . "${PRF}bashrc_once" && export BRCD_RANONCE=true +if [ -f "${PRF}bashrc_once" ] && [ -z "$BRCD_RANONCE" ]; then + export BRCD_RANONCE=true + . "${PRF}bashrc_once" + unset BRCD_RANONCE +fi [ -f "${PRF}bashrc_all" ] && . "${PRF}bashrc_all" [ -f "${PRF}bashrc_script" ] && shell_is_script && . "${PRF}bashrc_script" [ -f "${PRF}bashrc_interactive" ] && shell_is_interactive && . "${PRF}bashrc_interactive" From 5c4fdc440d89192d2d69a6a932d72f7231484bc0 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Mon, 28 Jun 2021 12:42:06 -0700 Subject: [PATCH 2/2] Make sure not to *un*set the double-inclusion guard variable --- bashrc_dispatch | 1 - 1 file changed, 1 deletion(-) diff --git a/bashrc_dispatch b/bashrc_dispatch index 7eadd4e..b160ad0 100644 --- a/bashrc_dispatch +++ b/bashrc_dispatch @@ -69,7 +69,6 @@ PRF="${HOME}/." if [ -f "${PRF}bashrc_once" ] && [ -z "$BRCD_RANONCE" ]; then export BRCD_RANONCE=true . "${PRF}bashrc_once" - unset BRCD_RANONCE fi [ -f "${PRF}bashrc_all" ] && . "${PRF}bashrc_all" [ -f "${PRF}bashrc_script" ] && shell_is_script && . "${PRF}bashrc_script"