@@ -28,15 +28,15 @@ program
28
28
. option ( '-t, --today' , 'Check the question today.' )
29
29
. option (
30
30
'-i, --identity <identity>' ,
31
- 'Check the specified question by identity.'
31
+ 'Check the specified question by identity.' ,
32
32
)
33
33
. option ( '-r, --random' , 'Check the last random question.' )
34
34
. option ( '-e, --easy' , 'Use easy mode.' )
35
35
. option ( '-d, --directory <directory>' , 'Set the question directory.' )
36
36
. option ( '-l, --language [language]' , 'Set/Get the code language of question.' )
37
37
. option (
38
38
'-u, --update' ,
39
- 'Check the version to determine whether to update to the latest one.'
39
+ 'Check the version to determine whether to update to the latest one.' ,
40
40
)
41
41
. parse ( process . argv )
42
42
@@ -56,7 +56,8 @@ const cmdOpts = program.opts()
56
56
if ( cmdOpts . language ) {
57
57
if ( cmdOpts . language !== true ) {
58
58
await easyLanguageView ( cmdOpts . language )
59
- } else {
59
+ }
60
+ else {
60
61
const lang = await getQuestionLanguage ( )
61
62
console . log ( `当前CLI语言环境为:${ lang } ` )
62
63
}
@@ -84,13 +85,14 @@ async function check(mode, question) {
84
85
const filePath = path . join (
85
86
baseDir ,
86
87
getQuestionFileName ( question ) ,
87
- `question${ getQuestionFileExtension ( question ?. lang ) } `
88
+ `question${ getQuestionFileExtension ( question ?. lang ) } ` ,
88
89
)
89
90
if ( ! fs . existsSync ( filePath ) ) {
90
91
console . log ( `文件[${ filePath } ]不存在,请确保已经创建!` )
91
- } else {
92
+ }
93
+ else {
92
94
console . log (
93
- `MODE: ${ mode } \n题目[${ getQuestionChineseName ( question ) } ]检测结果:`
95
+ `MODE: ${ mode } \n题目[${ getQuestionChineseName ( question ) } ]检测结果:` ,
94
96
)
95
97
await checkQuestion ( filePath )
96
98
}
@@ -114,7 +116,7 @@ const callModeAction = {
114
116
: await getQuestionById ( id )
115
117
await check ( 'identity' , question )
116
118
process . exit ( 0 )
117
- }
119
+ } ,
118
120
}
119
121
// 获取模式和参数
120
122
const mode = referMode ( cmdArgs , cmdOpts )
0 commit comments