@@ -11,7 +11,7 @@ import {
11
11
} from '#common/utils/create-check/createUtil.js'
12
12
import { getQuestionByKeyword } from '#common/utils/question-getter/getQuestionByKeyword.js'
13
13
14
- async function hotMode ( ) {
14
+ async function hotMode ( baseDir = process . cwd ( ) ) {
15
15
const createMode = await select ( {
16
16
message : '拉题模式' ,
17
17
choices : [
@@ -30,12 +30,12 @@ async function hotMode() {
30
30
}
31
31
const singleChoice = await select ( singleMode )
32
32
33
- await createQuestionByTitleSlug ( singleChoice )
33
+ await createQuestionByTitleSlug ( singleChoice , baseDir )
34
34
}
35
35
if ( createMode === 'all' ) await getHot100QuestionListCode ( )
36
36
}
37
37
38
- async function keywordMode ( ) {
38
+ async function keywordMode ( baseDir = process . cwd ( ) ) {
39
39
const keyword = await input ( { message : '请输入关键词' , name : 'keyword' } )
40
40
const data = await getQuestionByKeyword ( keyword )
41
41
const list = data ?. map ( ( q ) => {
@@ -52,11 +52,11 @@ async function keywordMode() {
52
52
}
53
53
const chooseQuestion = await select ( listQuestion )
54
54
console . log ( chooseQuestion )
55
- await createQuestionById ( chooseQuestion , process . cwd ( ) )
55
+ await createQuestionById ( chooseQuestion , baseDir )
56
56
}
57
- async function selectMode ( ) { }
57
+ async function selectMode ( baseDir ) { }
58
58
59
- export async function easyFinderView ( ) {
59
+ export async function easyFinderView ( baseDir = process . cwd ( ) ) {
60
60
const choices = [
61
61
{ name : '关键词搜索' , value : 'keyword' , description : '关键词描述' } ,
62
62
{
@@ -78,5 +78,5 @@ export async function easyFinderView() {
78
78
keyword : keywordMode ,
79
79
select : selectMode
80
80
}
81
- await modeMap [ mode ] ( )
81
+ await modeMap [ mode ] ( baseDir )
82
82
}
0 commit comments