From d7902bc18854df4d27760cfa68fda2e510369842 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Tue, 23 Sep 2025 21:44:40 +0200 Subject: [PATCH] feat(bash): add local file blacklist for user home dir (#49) Reviewed-on: https://codeberg.org/vlw/dotfiles/pulls/49 --- .bash_aliases | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.bash_aliases b/.bash_aliases index 9633fd1..6a325bd 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -20,6 +20,22 @@ l () { return fi + # Current directory is the user home directory + if [ "$(pwd)" == "$HOME" ]; then + # Ignore these files when running the "l" command from the home directory + local BLACKLIST=("Makefile") + + local pattern + local pattern_ignore + + for pattern in "${BLACKLIST[@]}"; do + pattern_ignore+="-I \"$pattern\" " + done + + eval ls -lh $pattern_ignore + return 0 + fi + ls -lh $1 || l $(dirname "$1") }