Skip to content

Commit

Permalink
Fixes cache bug.
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Wang <[email protected]>
  • Loading branch information
skygragon committed Jan 18, 2018
1 parent 959c4ae commit 5364b23
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/commands/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ const cmd = {
cmd.handler = function(argv) {
session.argv = argv;

const name = argv.keyword;
const isInteger = Number.isInteger(Number(name));

const caches = cache.list()
.filter(function(f) {
return argv.keyword.length === 0 || f.name.startsWith(argv.keyword + '.');
return (name.length === 0) ||
(isInteger ? f.name.startsWith(name + '.') : f.name === name);
});

if (argv.delete) {
Expand Down

0 comments on commit 5364b23

Please sign in to comment.