]> arthur.barton.de Git - ax-zsh.git/commitdiff
Add "ccache" plugin
authorAlexander Barton <alex@barton.de>
Sat, 18 Jul 2015 02:11:32 +0000 (04:11 +0200)
committerAlexander Barton <alex@barton.de>
Sat, 18 Jul 2015 02:11:32 +0000 (04:11 +0200)
plugins/ccache/ccache.zprofile [new file with mode: 0644]

diff --git a/plugins/ccache/ccache.zprofile b/plugins/ccache/ccache.zprofile
new file mode 100644 (file)
index 0000000..a55e12f
--- /dev/null
@@ -0,0 +1,23 @@
+# AX-ZSH: Alex' Modular ZSH Configuration
+# ccache.zprofile: Setup CCache environment
+
+# Make sure that "ccache(1)" is installed
+(( $+commands[ccache] )) || return
+
+# Setup cache location
+export CCACHE_DIR="$XDG_CACHE_HOME/ccache"
+
+# Search for directory with wrapper commands and prepend it to "PATH"
+for dir (
+       /usr/local/opt/ccache/libexec
+       /usr/local/lib/ccache
+       /opt/ccache/libexec
+       /usr/libexec/ccache
+       /usr/lib/ccache
+); do
+       if [[ -d "$dir" ]]; then
+               PATH="$dir:$PATH"
+               break
+       fi
+done
+unset dir