zsh: Set os/arch in zshenv
Alan Pearce alan@alanpearce.uk
Tue, 17 Jan 2017 11:38:48 +0100
2 files changed, 28 insertions(+), 4 deletions(-)
M tag-zsh/config/zsh/zshenv → tag-zsh/config/zsh/zshenv
@@ -16,4 +16,28 @@ if [[ -z $SSH_AUTH_SOCK ]] then export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket fi + + case $OSTYPE in + darwin*) + os=darwin + ;; + linux-gnu) + os=linux + ;; + freebsd*) + os=freebsd + ;; + *) + os=unknown + ;; + esac + + case $MACHTYPE in + *64) + arch=amd64 + ;; + *) + arch=386 + ;; + esac fi
M tag-zsh/config/zsh/zshrc → tag-zsh/config/zsh/zshrc
@@ -55,8 +55,8 @@ gnu_ls_isodate="--time-style=long-iso" bsd_ls_options="-p" bsd_ls_isodate="-D '%F %k:%M'" -case $OSTYPE in - darwin*) +case $os in + darwin) if [[ -n $commands[gls] ]] then ls='\gls' @@ -67,11 +67,11 @@ ls_options=$bsd_ls_options ls_isodate=$bsd_ls_isodate fi ;; - freebsd*) + freebsd) ls_options=$bsd_ls_options ls_isodate=$bsd_ls_isodate ;; - linux-gnu) + linux) ls_options=$gnu_ls_options ls_isodate=$gnu_ls_isodate ;;