Allow custom cache dir
We are running oh-my-zsh on a shared install and the only issue is each
user having a custom cache dir. This will allow us to set the cache dir
to ZSH_CACHE_DIR=~/oh-my-zsh/cache/ .
Diff
1diff --git a/lib/completion.zsh b/lib/completion.zsh
2index 3a19a4eba17a99faf2481a85110bea4f5937b9e7..ea6139fde2ad8d83952be42f4c33347423ebcc87 100644
3--- a/lib/completion.zsh
4+++ b/lib/completion.zsh
5@@ -38,7 +38,7 @@ cdpath=(.)
6 7 # Use caching so that commands like apt and dpkg complete are useable
8 zstyle ':completion::complete:*' use-cache 1
9-zstyle ':completion::complete:*' cache-path $ZSH/cache/
10+zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR
1112 # Don't complete uninteresting users
13 zstyle ':completion:*:*:*:users' ignored-patterns \
14diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
15index d75b521c76c0e2192f42d92b709bbe414b22998f..bc7a8e4966426a5f0f43c34153b7c5dbfac8240b 100644
16--- a/oh-my-zsh.sh
17+++ b/oh-my-zsh.sh
18@@ -14,6 +14,13 @@ if [[ -z "$ZSH_CUSTOM" ]]; then
19 ZSH_CUSTOM="$ZSH/custom"
20 fi
2122+# Set ZSH_CACHE_DIR to the path where cache files sould be created
23+# or else we will use the default cache/
24+if [[ -z "$ZSH_CACHE_DIR" ]]; then
25+ ZSH_CACHE_DIR="$ZSH/cache/"
26+fi
27+
28+
29 # Load all of the config files in ~/oh-my-zsh that end in .zsh
30 # TIP: Add files you don't want in git to .gitignore
31 for config_file ($ZSH/lib/*.zsh); do