Skip to content

Commit eaccfdd

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop
2 parents 74fed60 + 76fed5c commit eaccfdd

3 files changed

Lines changed: 30 additions & 6 deletions

File tree

.github/actions/publish-website/action.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ runs:
5151
if: always()
5252
run: docker stop mokapi || true
5353
shell: bash
54+
- name: build webui
55+
working-directory: ./webui
56+
run: |
57+
npm install
58+
npm version ${{ steps.release.outputs.release }}
59+
npm run build
60+
shell: bash
5461
- name: Build CLI doc
5562
run: go run ./cmd/internal/gen-cli-docs/main.go
5663
shell: bash
@@ -62,8 +69,6 @@ runs:
6269
- name: build website
6370
working-directory: ./webui
6471
run: |
65-
npm install
66-
npm version ${{ steps.release.outputs.release }}
6772
npm run copy-docs
6873
npm run build-sitemap
6974
npm run build-website

cmd/internal/gen-cli-docs/main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
package main
22

33
import (
4-
"fmt"
54
"mokapi/pkg/cmd/mokapi"
5+
"os"
66
)
77

88
func main() {
9-
cmd := mokapi.NewCmdMokapi()
10-
err := cmd.GenMarkdown("./docs/configuration/static")
9+
err := mokapi.NewGenCliDocCmd().Execute()
1110
if err != nil {
12-
fmt.Println(err.Error())
11+
_, _ = os.Stderr.Write([]byte(err.Error()))
1312
}
1413
}

pkg/cmd/mokapi/gen-cli.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package mokapi
2+
3+
import (
4+
"mokapi/pkg/cli"
5+
)
6+
7+
func NewGenCliDocCmd() *cli.Command {
8+
cmd := &cli.Command{
9+
Name: "generator for CLI documentation",
10+
Use: "gen-cli-doc [flags]",
11+
Run: func(cmd *cli.Command, args []string) error {
12+
c := NewCmdMokapi()
13+
return c.GenMarkdown(cmd.Flags().GetString("output-dir"))
14+
},
15+
}
16+
17+
cmd.Flags().StringShort("output-dir", "-o", "./docs/configuration/static", cli.FlagDoc{})
18+
19+
return cmd
20+
}

0 commit comments

Comments
 (0)