feat(bash): add local file blacklist for user home dir (#49)

Reviewed-on: https://codeberg.org/vlw/dotfiles/pulls/49
This commit is contained in:
Victor Westerlund 2025-09-23 21:44:40 +02:00
parent e7f78c8be5
commit d7902bc188

View file

@ -20,6 +20,22 @@ l () {
return return
fi 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") ls -lh $1 || l $(dirname "$1")
} }