Skip to content

Commit 3443ece

Browse files
committed
Update docs and tests
1 parent 6599554 commit 3443ece

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

doc/zplug.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,18 @@ the `$PATH`, you can run that command from anywhere just like any other commands
221221
'ZPLUG_USE_CACHE'::
222222
Defaults to `true`.
223223
If this variable is true, zplug uses a cache file to speed up the loading process.
224-
The cache file is located as `$ZPLUG_HOME/.cache`.
224+
The cache file is located at `$ZPLUG_CACHE_FILE` (`$ZPLUG_HOME/.cache` by default).
225225
If you want to clear the cache, please run `zplug clear` or do the following:
226226
227227
------------
228228
$ ZPLUG_USE_CACHE=false zplug load
229229
------------
230230
231+
'ZPLUG_CACHE_FILE'::
232+
Defaults to `$ZPLUG_HOME/.cache`.
233+
Specifies where to save the cache. For example, you can set this to
234+
`$HOME/.cache/zplug/cache` to follow XDG Base Directory Specification
235+
231236
232237
External commands
233238
-----------------

test/autoload/commands/__load___test.zsh

+10
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ describe "__load__"
3131
actual="$(zplug load --verbose | unansi)"
3232
assert.equals "$expect" "$actual"
3333
end
34+
35+
it "loads from cache at a custom location"
36+
export ZPLUG_USE_CACHE=true
37+
export ZPLUG_CACHE_FILE=$ZPLUG_HOME/foo/cache
38+
39+
mock_as_plugin "foo/bar"
40+
expect="Static loading..."
41+
actual="$(zplug load && zplug load --verbose)"
42+
assert.equals "$expect" "$actual"
43+
end
3444
end
3545

3646
: after

0 commit comments

Comments
 (0)