From 430bb6e7b9440dcc4d04c424191a67cf4e54f492 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Fri, 26 Jan 2018 09:24:07 -0800 Subject: [PATCH 1/3] Fix ls alias on MacOS. --- dotfiles/zshrc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dotfiles/zshrc b/dotfiles/zshrc index 243edc6..1d5f4b6 100755 --- a/dotfiles/zshrc +++ b/dotfiles/zshrc @@ -20,9 +20,13 @@ esac autoload -U colors && colors PS1="%{$fg[black]%}[%{$fg[yellow]%}%h%{$fg[black]%}] %{%(!.$fg[red].$fg[green])%}%8>..>%n%>>%{$fg[white]%}@%{$fg[blue]%}%12>..>%m%>>%{$fg[white]%}:%{$fg[green]%}%32<...<%~%<<%{$fg[white]%}%#%{$reset_color%} " -# LS Colors -alias ls='ls --color' -zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} +if [ `uname` != 'Darwin' ] ; then + # ls Colors + alias ls='ls --color' + zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} +else + alias ls='ls -G' +fi # Load oh-my-zsh if [ -d $HOME/.oh-my-zsh ] ; then From 48fb9289b4fa45c2511236bd90f4e61cfed92c89 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Fri, 26 Jan 2018 09:26:58 -0800 Subject: [PATCH 2/3] Nasty hack to fix find on MacOS. --- install.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index c6346f1..bb18a6b 100755 --- a/install.sh +++ b/install.sh @@ -3,6 +3,13 @@ set -o nounset set -o errexit +FINDTYPE="-xtype" + +if [ `uname` == 'Darwin' ] ; then + # MacOS specifics + FINDTYPE="-type" +fi + function prerequisites { if which zsh > /dev/null 2>&1 ; then if [[ $- == *i* ]] ; then @@ -30,7 +37,7 @@ function install_dotfile_dir { -name install.sh -o \ -name README.md -o \ -name .gitignore \) \ - -prune -o -xtype f -print | \ + -prune -o ${FINDTYPE} f -print | \ while read dotfile ; do local TARGET="${HOME}/.${dotfile#${SRCDIR}/}" mkdir -p `dirname "${TARGET}"` @@ -42,7 +49,7 @@ function install_basic_dir { local SRCDIR="${1}" local DESTDIR="${2}" local file - find "${SRCDIR}" -xtype f -print | \ + find "${SRCDIR}" ${FINDTYPE} f -print | \ while read file ; do local TARGET="${2}/${file#${SRCDIR}/}" mkdir -p `dirname "${TARGET}"` From db007ad6046538339feaed133208fada663c828d Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Fri, 26 Jan 2018 09:39:38 -0800 Subject: [PATCH 3/3] More MacOS fixes. --- dotfiles/aliases | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dotfiles/aliases b/dotfiles/aliases index 17d8fbb..800582f 100755 --- a/dotfiles/aliases +++ b/dotfiles/aliases @@ -8,10 +8,13 @@ alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo alias luksFormat='cryptsetup luksFormat -s 512 -c aes-xts-plain64 -h sha256 -i 15000' # Colors -alias ls='ls --color=auto' -alias grep='grep --color=auto' -alias egrep='egrep --color=auto' -alias fgrep='fgrep --color=auto' +if [ `uname` != 'Darwin' ] ; then + # Should have a better way to check for GNU versions + alias ls='ls --color=auto' + alias grep='grep --color=auto' + alias egrep='egrep --color=auto' + alias fgrep='fgrep --color=auto' +fi # Easy upgrade alias dist-upgrade="sudo sh -c 'apt-get update && apt-get -y dist-upgrade'"