From 7d9db28731e8d96848d9381eec3adf9415a41222 Mon Sep 17 00:00:00 2001 From: Shanshan Date: Tue, 16 Sep 2025 15:56:08 +0800 Subject: [PATCH] chore: mkdir if doc path not exists --- docs/user_docs/cli/_category_.yml | 5 ----- hack/docgen/cli/main.go | 9 +++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) delete mode 100644 docs/user_docs/cli/_category_.yml diff --git a/docs/user_docs/cli/_category_.yml b/docs/user_docs/cli/_category_.yml deleted file mode 100644 index dff53aca8..000000000 --- a/docs/user_docs/cli/_category_.yml +++ /dev/null @@ -1,5 +0,0 @@ -position: 30 -label: Command Line -collapsible: true -collapsed: true -className: hide-children \ No newline at end of file diff --git a/hack/docgen/cli/main.go b/hack/docgen/cli/main.go index 82db2cab2..7eb983a34 100644 --- a/hack/docgen/cli/main.go +++ b/hack/docgen/cli/main.go @@ -97,6 +97,15 @@ func main() { rootPath = os.Args[1] } + // normalize and ensure output directory exists + rootPath = filepath.Clean(rootPath) + + // 0o755 is an octal literal for Unix file permissions: rwxr-xr-x + // (owner can read/write/execute, group and others can read/execute) + if err := os.MkdirAll(rootPath, 0o755); err != nil { + log.Fatal(err) + } + fmt.Println("Scanning CLI docs rootPath: ", rootPath) cli := cmd.NewCliCmd() cli.Long = fmt.Sprintf("```\n%s\n```", cli.Long)