summaryrefslogtreecommitdiff
path: root/generator/app.go
diff options
context:
space:
mode:
authorKubernetes Submit Queue <k8s-merge-robot@users.noreply.github.com>2017-09-26 13:38:05 -0700
committerGitHub <noreply@github.com>2017-09-26 13:38:05 -0700
commitf0f37f4461be6ab1a45fabe905e1c8a7209cf0f9 (patch)
tree0a6ad1403f8877b918d428b654d81802f00c3d22 /generator/app.go
parent1eb3c68dab87330aa3352aba81ef4780fefef508 (diff)
parent3047fbcab22299f4575e1adf09f6dc9f31d62ea7 (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/app.go')
-rw-r--r--generator/app.go4
1 files changed, 2 insertions, 2 deletions
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
}