1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| .PHONY: build test clean install
|
| # 构建
| build:
| CGO_ENABLED=1 go build -tags fts5 -o bin/kb-cli .
|
| # 安装到 ~/go/bin
| install:
| CGO_ENABLED=1 go install -tags fts5 .
|
| # 测试
| test:
| CGO_ENABLED=1 go test -tags fts5 ./...
|
| # 详细测试
| test-v:
| CGO_ENABLED=1 go test -tags fts5 -v ./...
|
| # 清理
| clean:
| rm -rf bin/
| go clean
|
| # 运行示例
| run-search:
| ./bin/kb-cli search 充装 --top 5
|
| run-index:
| ./bin/kb-cli index build
|
| run-status:
| ./bin/kb-cli index status
|
|