summaryrefslogtreecommitdiff
path: root/generator
diff options
context:
space:
mode:
authorChristoph Blecker <admin@toph.ca>2017-09-25 12:36:24 -0700
committerChristoph Blecker <admin@toph.ca>2017-09-25 12:36:24 -0700
commit3047fbcab22299f4575e1adf09f6dc9f31d62ea7 (patch)
tree98f7217732abe525c2ad33bfe23caeda0cb1fad5 /generator
parentdcc58b928c3eff09edddf931b1d6b47464e770ff (diff)
Update generator to use WHAT variable
Diffstat (limited to 'generator')
-rw-r--r--generator/README.md11
-rw-r--r--generator/app.go4
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 99336c0d..b44eadcd 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
}