fix: auto gen warning on example env and use correct cli flag in md gen

This commit is contained in:
Stavros
2026-02-24 16:11:17 +02:00
parent 36b1594fb8
commit 699d8d173f
3 changed files with 6 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
# This file is automatically generated by gen/gen_env.go. Do not edit manually.
# Tinyauth example configuration # Tinyauth example configuration
# The base URL where the app is hosted. # The base URL where the app is hosted.

View File

@@ -106,6 +106,8 @@ func buildEnvChildPath(parent string, child string) string {
func compileEnv(entries []EnvEntry) []byte { func compileEnv(entries []EnvEntry) []byte {
buffer := bytes.Buffer{} buffer := bytes.Buffer{}
buffer.WriteString("# This file is automatically generated by gen/gen_env.go. Do not edit manually.\n\n")
buffer.WriteString("# Tinyauth example configuration\n\n") buffer.WriteString("# Tinyauth example configuration\n\n")
previousSection := "" previousSection := ""

View File

@@ -56,7 +56,7 @@ func buildMdEntry(child reflect.StructField, childValue reflect.Value, parentPat
entry := MarkdownEntry{ entry := MarkdownEntry{
Env: strings.ToUpper(strings.ReplaceAll(parentPath, ".", "_")) + strings.ToUpper(child.Name), Env: strings.ToUpper(strings.ReplaceAll(parentPath, ".", "_")) + strings.ToUpper(child.Name),
Flag: fmt.Sprintf("--%s%s", strings.TrimPrefix(parentPath, "tinyauth."), tag), Flag: fmt.Sprintf("--%s%s", strings.TrimPrefix(parentPath, "tinyauth."), strings.ToLower(child.Name)),
Description: desc, Description: desc,
} }
@@ -104,6 +104,7 @@ func buildMdChildPath(parent string, child string) string {
func compileMd(entries []MarkdownEntry) []byte { func compileMd(entries []MarkdownEntry) []byte {
buffer := bytes.Buffer{} buffer := bytes.Buffer{}
buffer.WriteString("<!--- This file is automatically generated by gen/gen_md.go. Do not edit manually. --->\n\n")
buffer.WriteString("# Tinyauth configuration reference\n\n") buffer.WriteString("# Tinyauth configuration reference\n\n")
buffer.WriteString("| Environment | Flag | Description | Default |\n") buffer.WriteString("| Environment | Flag | Description | Default |\n")
buffer.WriteString("| - | - | - | - |\n") buffer.WriteString("| - | - | - | - |\n")