From: Alexander Barton Date: Tue, 17 Mar 2015 13:40:34 +0000 (+0100) Subject: 1_local.plugin.zsh: Setup locale cache and home directory paths X-Git-Url: https://arthur.barton.de/gitweb/?p=OhMyZshExtensions.git;a=commitdiff_plain;h=a3eae3b6dd7ab70954bf5d66af9298e42b9b3986 1_local.plugin.zsh: Setup locale cache and home directory paths --- diff --git a/plugins/1_local/1_local.plugin.zsh b/plugins/1_local/1_local.plugin.zsh new file mode 100644 index 0000000..27a6c3a --- /dev/null +++ b/plugins/1_local/1_local.plugin.zsh @@ -0,0 +1,15 @@ +# 1_local.plugin.zsh +# 2015-03-17, alex@barton.de + +[ -d "/usr/local/home" -a ! -d "/usr/local/home/$LOGNAME" ] \ + && mkdir "/usr/local/home/$LOGNAME" >/dev/null 2>&1 + +[ -w "/usr/local/home/$LOGNAME" ] \ + && export LOCAL_HOME="/usr/local/home/$LOGNAME" \ + || export LOCAL_HOME="$HOME" + +# Setup XDG cache directory +export XDG_CACHE_HOME="$LOCAL_HOME/.cache" + +# Setup environment for ccache, if installed +type ccache >/dev/null && export CCACHE_DIR="$XDG_CACHE_HOME/ccache"