From fc198102de2f7d6601051ea060518e0b1b1cfaad Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Thu, 5 May 2022 16:50:05 +0300 Subject: [PATCH] fix installer --- bash_rc | 10 ++++------ bashrc.d/{always_screen => ZZZ_always_screen} | 0 install_my_bashrc.sh | 5 +++-- 3 files changed, 7 insertions(+), 8 deletions(-) rename bashrc.d/{always_screen => ZZZ_always_screen} (100%) diff --git a/bash_rc b/bash_rc index 3414557..2d4b8ca 100755 --- a/bash_rc +++ b/bash_rc @@ -32,7 +32,7 @@ source "${HOME}/.bashrc_ps1" # Format history records export HISTTIMEFORMAT="[%s] " # Append to history file -#PROMPT_COMMAND="history -a; $PROMPT_COMMAND" +PROMPT_COMMAND="history -a; $PROMPT_COMMAND" # Share between shells PROMPT_COMMAND="history -c; history -r; $PROMPT_COMMAND" # Don't overwrite it history @@ -115,12 +115,10 @@ export SCREENDIR="${HOME}/.screen" # Set other bashrc files mkdir -p "${HOME}/.bashrc.d" -while read -r bashrc_file +for bashrc_file in $(find "${HOME}/.bashrc.d" -type f | sort | grep -v ~$) do - if [ -z "${bashrc_file}" ]; then + if [ -n "${bashrc_file}" ]; then # shellcheck disable=SC1090 source "${bashrc_file}" fi -done <<< "$(find "${HOME}/.bashrc.d" -type f | sort | grep -v ~$)" - -#[ -z "$TMUX" ] && { tmux attach || exec tmux new-session && exit;} +done diff --git a/bashrc.d/always_screen b/bashrc.d/ZZZ_always_screen similarity index 100% rename from bashrc.d/always_screen rename to bashrc.d/ZZZ_always_screen diff --git a/install_my_bashrc.sh b/install_my_bashrc.sh index 24ebc5f..f6b249a 100755 --- a/install_my_bashrc.sh +++ b/install_my_bashrc.sh @@ -5,5 +5,6 @@ my_dir=$(dirname "${0}") if [ -e "${HOME}/.bashrc" ]; then mv "${HOME}/.bashrc" "${HOME}/.bashrc.bak" fi -cp "${my_dir}/bash_rc" "${HOME}/.bashrc" -rfp -cp "${my_dir}/bashrc.d" "${HOME}/.bashrc.d" -rfp +cd "${my_dir}" ||exit 1 +cp bash_rc "${HOME}/.bashrc" -rfp +cp bashrc.d/* "${HOME}/.bashrc.d/" -rfp