mirror of
https://codeberg.org/vlw/dotfiles.git
synced 2025-11-05 01:12:42 +01:00
feat(bash): add local file blacklist for user home dir
This commit is contained in:
parent
e7f78c8be5
commit
de89ac47b6
1 changed files with 16 additions and 0 deletions
|
|
@ -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")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue