Skip to content

Commit

Permalink
use single entry for command execution
Browse files Browse the repository at this point in the history
  • Loading branch information
lujiajing1126 committed Dec 26, 2018
1 parent ce61c3d commit a9d49d0
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions lib/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,7 @@ class RedisClient {
readline.cursorTo(process.stdout, 0, 0);
readline.clearScreenDown(process.stdout);
} else {
let func = this._redis_client[`${CMD}Async`];
if (typeof func == "function") {
let result = await func.bind(this._redis_client)(...commands);
if (Array.isArray(result)) {
result.forEach((item, index) => {
console.log("%d) %s", index, item);
});
} else {
console.log(result);
}
} else {
console.log(colors.red(`(error) ${CMD} is not supported`));
}
this.execute(commands);
}
}
rl.prompt();
Expand Down

0 comments on commit a9d49d0

Please sign in to comment.