From 8d7c8a0c4eb6886c01f5acf1bbf9f701e3ae8658 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Sun, 17 Dec 2023 22:38:45 +0200 Subject: [PATCH] Move .bashrc sourced files to ~/.bashrc.d/ . Going to make things more modular and I can add files there that aren't included in the repo. --- .bashrc | 14 ++++++++++++-- .bashrc.private.j2 => .bashrc.d/private.j2 | 0 2 files changed, 12 insertions(+), 2 deletions(-) rename .bashrc.private.j2 => .bashrc.d/private.j2 (100%) diff --git a/.bashrc b/.bashrc index 1573d45..7271939 100644 --- a/.bashrc +++ b/.bashrc @@ -1,7 +1,19 @@ # shellcheck disable=SC2148 shell=bash +# vim: ft=sh + # If not running interactively, don't do anything [ -z "$PS1" ] && return +# Source all of the files in ~/.bashrc.d +for sourcefile in "$HOME"/.bashrc.d/* +do + if [ -f "$sourcefile" ] && [ "$sourcefile" = "${sourcefile%.j2}" ] + then + # shellcheck disable=SC1090 + . "$sourcefile" + fi +done + export ANSIBLE_CACHE_PLUGIN=jsonfile export ANSIBLE_CACHE_PLUGIN_CONNECTION="$HOME/.ansible/facts" export ANSIBLE_CALLBACKS_ENABLED="ansible.posix.profile_tasks, ansible.posix.timer" @@ -72,8 +84,6 @@ export PYTHON_GITLAB_CFG=~/.config/python-gitlab.cfg export REDISCLI_HISTFILE="$HOME/Documents/.rediscli_history" export TF_DEBUG=1 export VAGRANT_DEFAULT_PROVIDER="virtualbox" -# shellcheck disable=SC1090,SC1091 -[ ! -f "$HOME/.bashrc.private" ] || . "$HOME/.bashrc.private" alias 0-day-cleanup='ssh kodi.shore.co.il "sudo -u debian-transmission find /srv/library/Comics -name *.part -path *0-Day\ Week\ of* -delete"' alias all-hosts='echo -n ns1 ns4 host01 kodi mr8300 | xargs -d " " -I HOST ssh HOST.shore.co.il' diff --git a/.bashrc.private.j2 b/.bashrc.d/private.j2 similarity index 100% rename from .bashrc.private.j2 rename to .bashrc.d/private.j2 -- GitLab