From a3eae3b6dd7ab70954bf5d66af9298e42b9b3986 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 17 Mar 2015 14:40:34 +0100 Subject: [PATCH] 1_local.plugin.zsh: Setup locale cache and home directory paths --- plugins/1_local/1_local.plugin.zsh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 plugins/1_local/1_local.plugin.zsh 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" -- 2.39.2