File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -48,19 +48,11 @@ function entry(cwd = process.cwd(), args) {
48
48
49
49
return hexo . init ( ) ;
50
50
} ) . then ( ( ) => {
51
- let cmd = '' ;
51
+ let cmd = 'help ' ;
52
52
53
53
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 ;
64
56
}
65
57
66
58
watchSignal ( hexo ) ;
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const { platform, release } = require('os');
7
7
const { format } = require ( 'util' ) ;
8
8
const cliVersion = require ( '../../package.json' ) . version ;
9
9
const rewire = require ( 'rewire' ) ;
10
- const { spawn } = require ( 'hexo-util' )
10
+ const { spawn } = require ( 'hexo-util' ) ;
11
11
12
12
function getConsoleLog ( { args } ) {
13
13
return args . map ( arr => format . apply ( null , arr ) ) . join ( '\n' ) ;
@@ -39,7 +39,7 @@ describe('version', () => {
39
39
40
40
if ( process . env . CI === 'true' ) {
41
41
if ( process . platform === 'darwin' ) {
42
- const osInfo = await spawn ( 'sw_vers' , '-productVersion' )
42
+ const osInfo = await spawn ( 'sw_vers' , '-productVersion' ) ;
43
43
output . should . contain ( `os: ${ platform ( ) } ${ release ( ) } ${ osInfo } ` ) ;
44
44
} else if ( process . platform === 'linux' ) {
45
45
const v = await spawn ( 'cat' , '/etc/os-release' ) ;
You can’t perform that action at this time.
0 commit comments