Skip to content

Commit d5b558b

Browse files
committed
refactor: let command default to be 'help'
1 parent 61a9717 commit d5b558b

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

lib/hexo.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,11 @@ function entry(cwd = process.cwd(), args) {
4848

4949
return hexo.init();
5050
}).then(() => {
51-
let cmd = '';
51+
let cmd = 'help';
5252

5353
if (!args.h && !args.help) {
54-
cmd = args._.shift();
55-
56-
if (cmd) {
57-
const c = hexo.extend.console.get(cmd);
58-
if (!c) cmd = 'help';
59-
} else {
60-
cmd = 'help';
61-
}
62-
} else {
63-
cmd = 'help';
54+
const c = args._.shift();
55+
if (c && hexo.extend.console.get(c)) cmd = c;
6456
}
6557

6658
watchSignal(hexo);

0 commit comments

Comments
 (0)