Skip to content

Commit 2f591ed

Browse files
committed
chore: better notice
1 parent 880e17a commit 2f591ed

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CODING cli 基于 [Laravel Zero](https://laravel-zero.com/)。
99
## Docker 方式运行
1010

1111
```shell
12+
docker pull ecoding/coding-cli
1213
docker run -it ecoding/coding-cli
1314
docker run -it ecoding/coding-cli wiki:import --help
1415
docker run -it -v $(pwd):/root --env CODING_TOKEN=foo --env CONFLUENCE_USERNAME=admin ecoding/coding-cli wiki:import

app/Commands/WikiImportCommand.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class WikiImportCommand extends Command
1919
*/
2020
protected $signature = 'wiki:import
2121
{--coding_import_provider= : 数据来源,如 Confluence、MediaWiki}
22-
{--coding_import_data_type= : 数据来源,如 HTML、API}
23-
{--coding_import_data_path= : 数据路径,如 ~/Downloads/confluence/space-1/}
22+
{--coding_import_data_type= : 数据类型,如 HTML、API}
23+
{--coding_import_data_path= : 空间导出的 HTML 目录,如 ./confluence/space1/}
2424
{--confluence_base_uri= : Confluence API URL,如 http://localhost:8090/confluence/rest/api/}
2525
{--confluence_username=}
2626
{--confluence_password=}
@@ -136,7 +136,10 @@ private function handleConfluenceHtml(): int
136136
if ($this->option('coding_import_data_path')) {
137137
$dataPath = $this->option('coding_import_data_path');
138138
} else {
139-
$dataPath = config('coding.import.data_path') ?? trim($this->ask('路径:'));
139+
$dataPath = config('coding.import.data_path') ?? trim($this->ask(
140+
'空间导出的 HTML 目录',
141+
'./confluence/space1/'
142+
));
140143
}
141144
$dataPath = str_ends_with($dataPath, '/index.html') ? substr($dataPath, 0, -10) : Str::finish($dataPath, '/');
142145
$filePath = $dataPath . 'index.html';

tests/Feature/WikiImportCommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ public function testHandleConfluenceHtmlFileNotExist()
132132
$this->artisan('wiki:import')
133133
->expectsQuestion('数据来源?', 'Confluence')
134134
->expectsQuestion('数据类型?', 'HTML')
135-
->expectsQuestion('路径:', '~/Downloads/')
135+
->expectsQuestion('空间导出的 HTML 目录', '~/Downloads/')
136136
->expectsOutput('文件不存在:~/Downloads/index.html')
137137
->assertExitCode(1);
138138

139139
$this->artisan('wiki:import')
140140
->expectsQuestion('数据来源?', 'Confluence')
141141
->expectsQuestion('数据类型?', 'HTML')
142-
->expectsQuestion('路径:', '~/Downloads/index.html')
142+
->expectsQuestion('空间导出的 HTML 目录', '~/Downloads/index.html')
143143
->expectsOutput('文件不存在:~/Downloads/index.html')
144144
->assertExitCode(1);
145145
}
@@ -166,7 +166,7 @@ public function testHandleConfluenceHtmlSuccess()
166166
$this->artisan('wiki:import')
167167
->expectsQuestion('数据来源?', 'Confluence')
168168
->expectsQuestion('数据类型?', 'HTML')
169-
->expectsQuestion('路径:', $this->dataDir . 'confluence/space1/')
169+
->expectsQuestion('空间导出的 HTML 目录', $this->dataDir . 'confluence/space1/')
170170
->expectsOutput('空间名称:空间 1')
171171
->expectsOutput('空间标识:space1')
172172
->expectsOutput('发现 2 个一级页面')

0 commit comments

Comments
 (0)