Skip to content

Commit 7d9db28

Browse files
committed
chore: mkdir if doc path not exists
1 parent 699766e commit 7d9db28

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

docs/user_docs/cli/_category_.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

hack/docgen/cli/main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ func main() {
9797
rootPath = os.Args[1]
9898
}
9999

100+
// normalize and ensure output directory exists
101+
rootPath = filepath.Clean(rootPath)
102+
103+
// 0o755 is an octal literal for Unix file permissions: rwxr-xr-x
104+
// (owner can read/write/execute, group and others can read/execute)
105+
if err := os.MkdirAll(rootPath, 0o755); err != nil {
106+
log.Fatal(err)
107+
}
108+
100109
fmt.Println("Scanning CLI docs rootPath: ", rootPath)
101110
cli := cmd.NewCliCmd()
102111
cli.Long = fmt.Sprintf("```\n%s\n```", cli.Long)

0 commit comments

Comments
 (0)