feat: Utilise nullglob pour éviter les erreurs de répertoires vides

This commit is contained in:
Xavier Logerais 2024-06-28 08:31:10 +00:00
parent 0c749a5fd0
commit cb323ec6c0

6
bashrc
View File

@ -11,6 +11,9 @@ if [[ $- != *i* ]]; then
return return
fi fi
# Safe loops for empty dirs
shopt -s nullglob
# Source custom libs # Source custom libs
if [ -d "$HOME"/.bash/libs ]; then for lib in "$HOME"/.bash/libs/*.bash; do source "$lib"; done; fi if [ -d "$HOME"/.bash/libs ]; then for lib in "$HOME"/.bash/libs/*.bash; do source "$lib"; done; fi
@ -36,3 +39,6 @@ if [ -d "$HOME"/.bash/completion.d ]; then for file in "$HOME"/.bash/completion.
# Late customization # Late customization
if [ -d "$HOME"/.bash/rc.after.d ]; then for file in "$HOME"/.bash/rc.after.d/*; do source "$file"; done; fi if [ -d "$HOME"/.bash/rc.after.d ]; then for file in "$HOME"/.bash/rc.after.d/*; do source "$file"; done; fi
# Restore option nullglob to normal
shopt -u nullglob