diff options
| author | Kubernetes Submit Queue <k8s-merge-robot@users.noreply.github.com> | 2017-09-26 13:38:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-26 13:38:05 -0700 |
| commit | f0f37f4461be6ab1a45fabe905e1c8a7209cf0f9 (patch) | |
| tree | 0a6ad1403f8877b918d428b654d81802f00c3d22 /generator | |
| parent | 1eb3c68dab87330aa3352aba81ef4780fefef508 (diff) | |
| parent | 3047fbcab22299f4575e1adf09f6dc9f31d62ea7 (diff) | |
Merge pull request #1127 from cblecker/generator-what
Automatic merge from submit-queue. .
Update generator to use WHAT variable
Having to set two different variables is confusing. Changed this to look at the `WHAT` envvar and match on a suffix.
Fixes #1126.
cc: @jamiehannaford
Diffstat (limited to 'generator')
| -rw-r--r-- | generator/README.md | 11 | ||||
| -rw-r--r-- | generator/app.go | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/generator/README.md b/generator/README.md index d2382aa5..92340f19 100644 --- a/generator/README.md +++ b/generator/README.md @@ -30,15 +30,16 @@ To (re)build documentation for all the SIGs, run these commands: make all ``` -To build docs for one SIG, run these commands: +To build docs for one SIG, run one these commands: ```bash -make SIG=sig-apps gen-docs -make SIG=sig-testing gen-docs -make WG=resource-management gen-docs +make WHAT=sig-apps +make WHAT=cluster-lifecycle +make WHAT=wg-resource-management +make WHAT=container-identity ``` -where the `SIG` or `WG` var refers to the directory being built. +where the `WHAT` var refers to the directory being built. ## Adding custom content to your README diff --git a/generator/app.go b/generator/app.go index e0dd17b1..0638e1a2 100644 --- a/generator/app.go +++ b/generator/app.go @@ -200,14 +200,14 @@ func writeCustomContentBlock(f *os.File, content string) { func createGroupReadme(groups []Group, prefix string) error { // figure out if the user wants to generate one group var selectedGroupName *string - if envVal, ok := os.LookupEnv(strings.ToUpper(prefix)); ok { + if envVal, ok := os.LookupEnv("WHAT"); ok { selectedGroupName = &envVal } for _, group := range groups { group.Dir = group.DirName(prefix) // skip generation if the user specified only one group - if selectedGroupName != nil && *selectedGroupName != group.Dir { + if selectedGroupName != nil && strings.HasSuffix(group.Dir, *selectedGroupName) == false { fmt.Printf("Skipping %s/README.md\n", group.Dir) continue } |
