From 2d8b9a5309ba0712f39f24fdd7ab40c7c14fc847 Mon Sep 17 00:00:00 2001 From: Xavier Logerais Date: Wed, 22 Jul 2026 22:19:07 +0200 Subject: [PATCH] feat(profile): use existing helpers to manage profile files (just like rc ones) --- bash_profile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bash_profile b/bash_profile index 6d280c3..39f1384 100644 --- a/bash_profile +++ b/bash_profile @@ -39,9 +39,12 @@ if [ -z "${BASH_CONFIG_DIR}" ]; then BASH_CONFIG_DIR=$(get_script_dir) fi -if [ -f "${BASH_CONFIG_DIR}"/profile ]; then source "${BASH_CONFIG_DIR}"/profile; fi -if [ -d "${BASH_CONFIG_DIR}"/profile ]; then for file in "${BASH_CONFIG_DIR}"/profile/*; do source "$file"; done; fi -if [ -d "${BASH_CONFIG_DIR}"/profile.d ]; then for file in "${BASH_CONFIG_DIR}"/profile.d/*; do source "$file"; done; fi +# Source some helpers functions +source "${BASH_CONFIG_DIR}/_helpers.bash" + +_source_file_if_exists "${BASH_CONFIG_DIR}/profile" +_source_dir_files "${BASH_CONFIG_DIR}/profile" +_source_dir_files "${BASH_CONFIG_DIR}/profile.d" # This file is sourced by bash for login shells. The following line # runs your .bashrc and is recommended by the bash info pages.