ls: find and use various dircolors initialisation files, if they exist

Closes #1758.
This commit is contained in:
David Adam 2014-10-17 10:23:05 +08:00
parent 9e32b330aa
commit 4aa38db56f

View file

@ -14,7 +14,15 @@ if command ls --version 1>/dev/null 2>/dev/null
if not set -q LS_COLORS
if type -q -f dircolors
eval (dircolors -c | sed 's/>&\/dev\/null$//')
set -l colorfile
for file in ~/.dir_colors ~/.dircolors /etc/DIR_COLORS
if test -f $file
set colorfile $file
break
end
end
echo $colorfile
eval (dircolors -c $colorfile | sed 's/>&\/dev\/null$//')
end
end