From 6b0d6af2f89fb2a0e0ddcfb6d85cf31a173af3d4 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Thu, 10 Feb 2022 20:07:37 +0100 Subject: [PATCH] [bash] rename bash/rc and bash/bash.d --- .install.conf.yaml | 2 +- bash/{rc => bashrc} | 4 ++-- bash/{bash.d/aliases => bashrc.d/aliases.bash} | 2 +- bash/{bash.d/colours => bashrc.d/colours.bash} | 0 bash/{bash.d/gpg-agent => bashrc.d/gpg-agent.bash} | 0 bash/{bash.d/history => bashrc.d/history.bash} | 0 bash/{bash.d => bashrc.d}/network.bash | 0 .../{bash.d/password-store => bashrc.d/password-store.bash} | 0 .../{bash.d/prompt_command => bashrc.d/prompt_command.bash} | 0 profiles/main.sh | 6 ++++-- 10 files changed, 8 insertions(+), 6 deletions(-) rename bash/{rc => bashrc} (89%) rename bash/{bash.d/aliases => bashrc.d/aliases.bash} (97%) rename bash/{bash.d/colours => bashrc.d/colours.bash} (100%) rename bash/{bash.d/gpg-agent => bashrc.d/gpg-agent.bash} (100%) rename bash/{bash.d/history => bashrc.d/history.bash} (100%) rename bash/{bash.d => bashrc.d}/network.bash (100%) rename bash/{bash.d/password-store => bashrc.d/password-store.bash} (100%) rename bash/{bash.d/prompt_command => bashrc.d/prompt_command.bash} (100%) diff --git a/.install.conf.yaml b/.install.conf.yaml index 8a10d85..7ce9793 100644 --- a/.install.conf.yaml +++ b/.install.conf.yaml @@ -6,7 +6,7 @@ - clean: ['~'] - link: - ~/.bashrc: bash/rc + ~/.bashrc: bash/bashrc ~/.bash_profile: bash/profile ~/.config/git/config: git/config ~/.config/git/ignore_global: git/ignore diff --git a/bash/rc b/bash/bashrc similarity index 89% rename from bash/rc rename to bash/bashrc index 43f0b49..51169f4 100644 --- a/bash/rc +++ b/bash/bashrc @@ -30,8 +30,8 @@ if [ -f /etc/bash_completion ] && ! shopt -oq posix; then fi # Load main things -if [ -d "$DOTBASH/bash.d" ]; then - for f in colours aliases history prompt_command password-store +if [ -d "$DOTBASH/bashrc.d" ]; then + for f in colours.bash aliases.bash history.bash prompt_command.bash password-store.bash network.bash do if [ -r "$DOTBASH/bash.d/$f" ]; then source "$DOTBASH/bash.d/$f" diff --git a/bash/bash.d/aliases b/bash/bashrc.d/aliases.bash similarity index 97% rename from bash/bash.d/aliases rename to bash/bashrc.d/aliases.bash index 62ba717..44e024c 100644 --- a/bash/bash.d/aliases +++ b/bash/bashrc.d/aliases.bash @@ -22,7 +22,7 @@ alias l='ls -CF' alias mkdir='mkdir -p -v' # Use vim if possible instead of vi -if [[ $(command -v vim) ]]; then +if command -v vim > /dev/null; then alias vi='vim' else alias vim='vi' diff --git a/bash/bash.d/colours b/bash/bashrc.d/colours.bash similarity index 100% rename from bash/bash.d/colours rename to bash/bashrc.d/colours.bash diff --git a/bash/bash.d/gpg-agent b/bash/bashrc.d/gpg-agent.bash similarity index 100% rename from bash/bash.d/gpg-agent rename to bash/bashrc.d/gpg-agent.bash diff --git a/bash/bash.d/history b/bash/bashrc.d/history.bash similarity index 100% rename from bash/bash.d/history rename to bash/bashrc.d/history.bash diff --git a/bash/bash.d/network.bash b/bash/bashrc.d/network.bash similarity index 100% rename from bash/bash.d/network.bash rename to bash/bashrc.d/network.bash diff --git a/bash/bash.d/password-store b/bash/bashrc.d/password-store.bash similarity index 100% rename from bash/bash.d/password-store rename to bash/bashrc.d/password-store.bash diff --git a/bash/bash.d/prompt_command b/bash/bashrc.d/prompt_command.bash similarity index 100% rename from bash/bash.d/prompt_command rename to bash/bashrc.d/prompt_command.bash diff --git a/profiles/main.sh b/profiles/main.sh index 77a7cce..9544c7b 100644 --- a/profiles/main.sh +++ b/profiles/main.sh @@ -40,7 +40,9 @@ then fi # if this is BASH source BASHRC -if [ "$BASH" ] && [ -f $DOTFILES/bash/rc ] +DOTBASHRC="$DOTFILES/bash/bashrc" +if [ "$BASH" ] && [ -r "$DOTBASHRC" ] then - source $DOTFILES/bash/rc + source "$DOTBASHRC" fi +unset DOTBASHRC