Make the ls color available for macos

pull/2082/head
Gurkirat Singh 2022-02-08 14:27:48 +05:30 committed by GitHub
parent 4dbe92e38d
commit 2b8928f2bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 7 deletions

View File

@ -1,13 +1,18 @@
cite about-alias cite about-alias
about-alias 'general aliases' about-alias 'general aliases'
if ls --color -d . &> /dev/null # color support for darwin and non-darwin os
then # special thanks https://stackoverflow.com/a/27776822/10362396
alias ls="ls --color=auto" case "$(uname -s)" in
elif ls -G -d . &> /dev/null
then Darwin)
alias ls='ls -G' # Compact view, show colors alias ls='ls -G'
fi ;;
*)
alias ls='ls --color=auto'
;;
esac
# List directory contents # List directory contents
alias sl=ls alias sl=ls