Skip to content

Commit 699d8d1

Browse files
committed
fix: auto gen warning on example env and use correct cli flag in md gen
1 parent 36b1594 commit 699d8d1

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This file is automatically generated by gen/gen_env.go. Do not edit manually.
2+
13
# Tinyauth example configuration
24

35
# The base URL where the app is hosted.

gen/gen_env.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ func buildEnvChildPath(parent string, child string) string {
106106

107107
func compileEnv(entries []EnvEntry) []byte {
108108
buffer := bytes.Buffer{}
109+
110+
buffer.WriteString("# This file is automatically generated by gen/gen_env.go. Do not edit manually.\n\n")
109111
buffer.WriteString("# Tinyauth example configuration\n\n")
110112

111113
previousSection := ""

gen/gen_md.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func buildMdEntry(child reflect.StructField, childValue reflect.Value, parentPat
5656

5757
entry := MarkdownEntry{
5858
Env: strings.ToUpper(strings.ReplaceAll(parentPath, ".", "_")) + strings.ToUpper(child.Name),
59-
Flag: fmt.Sprintf("--%s%s", strings.TrimPrefix(parentPath, "tinyauth."), tag),
59+
Flag: fmt.Sprintf("--%s%s", strings.TrimPrefix(parentPath, "tinyauth."), strings.ToLower(child.Name)),
6060
Description: desc,
6161
}
6262

@@ -104,6 +104,7 @@ func buildMdChildPath(parent string, child string) string {
104104
func compileMd(entries []MarkdownEntry) []byte {
105105
buffer := bytes.Buffer{}
106106

107+
buffer.WriteString("<!--- This file is automatically generated by gen/gen_md.go. Do not edit manually. --->\n\n")
107108
buffer.WriteString("# Tinyauth configuration reference\n\n")
108109
buffer.WriteString("| Environment | Flag | Description | Default |\n")
109110
buffer.WriteString("| - | - | - | - |\n")

0 commit comments

Comments
 (0)