Skip to content

Commit 5364b23

Browse files
committedJan 18, 2018
Fixes cache bug.
Signed-off-by: Eric Wang <skygragon@gmail.com>
1 parent 959c4ae commit 5364b23

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎lib/commands/cache.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ const cmd = {
3434
cmd.handler = function(argv) {
3535
session.argv = argv;
3636

37+
const name = argv.keyword;
38+
const isInteger = Number.isInteger(Number(name));
39+
3740
const caches = cache.list()
3841
.filter(function(f) {
39-
return argv.keyword.length === 0 || f.name.startsWith(argv.keyword + '.');
42+
return (name.length === 0) ||
43+
(isInteger ? f.name.startsWith(name + '.') : f.name === name);
4044
});
4145

4246
if (argv.delete) {

0 commit comments

Comments
 (0)
Please sign in to comment.