]> arthur.barton.de Git - OhMyZshExtensions.git/blob - plugins/ccache/ccache.plugin.zsh
Add "ccache" plugin: Initialize ccache(1)
[OhMyZshExtensions.git] / plugins / ccache / ccache.plugin.zsh
1 # ccache.plugin.zsh
2 # 2015-03-27, alex@barton.de
3
4 if type ccache >/dev/null; then
5         # Setup environment for ccache, if installed
6         export CCACHE_DIR="$XDG_CACHE_HOME/ccache"
7
8         # Search for directory with wrapper commands and prepend it to "PATH"
9         for d in \
10                 /usr/local/opt/ccache/libexec \
11                 /usr/local/lib/ccache \
12                 /opt/ccache/libexec \
13                 /usr/libexec/ccache \
14                 /usr/lib/ccache \
15         ; do
16                 if [ -d "$d" ]; then
17                         PATH="$d:$PATH"
18                         break
19                 fi
20         done
21 fi