From de89ac47b657ce1ddc6ac7cb485b0069edca217e Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Tue, 23 Sep 2025 21:43:53 +0200 Subject: [PATCH] feat(bash): add local file blacklist for user home dir --- .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") }