@@ -37,12 +37,12 @@ func run(ctx context.Context, args []string) error {
37
37
fmt .Println ("xbarapp.com site generator" , version )
38
38
flags := flag .NewFlagSet (args [0 ], flag .ContinueOnError )
39
39
var (
40
- out = flags .String ("out" , "../../xbarapp.com/public/docs" , "output folder" )
41
- small = flags .Bool ("small" , false , "run only a small sample (default is to process all)" )
42
- skipdata = flags .Bool ("skipdata" , false , "skip the data - just render the index template" )
43
- errs = flags .Bool ("errs" , false , "print out error details" )
44
- nodocs = flags .Bool ("nodocs" , false , "skip docs generation" )
45
- verbose = flags .Bool ("verbose" , false , "verbose output" )
40
+ out = flags .String ("out" , "../../xbarapp.com/public/docs" , "output folder" )
41
+ small = flags .Bool ("small" , false , "run only a small sample (default is to process all)" )
42
+ skipdata = flags .Bool ("skipdata" , false , "skip the data - just render the index template" )
43
+ shouldPrintErrs = flags .Bool ("errs" , false , "print out error details" )
44
+ nodocs = flags .Bool ("nodocs" , false , "skip docs generation" )
45
+ verbose = flags .Bool ("verbose" , false , "verbose output" )
46
46
)
47
47
if err := flags .Parse (args [1 :]); err != nil {
48
48
return err
@@ -80,7 +80,7 @@ func run(ctx context.Context, args []string) error {
80
80
EachPluginFn : eachPlugin ,
81
81
GitHubAccessToken : os .Getenv ("XBAR_GITHUB_ACCESS_TOKEN" ),
82
82
SmallSample : * small ,
83
- PrintErrors : * errs ,
83
+ PrintErrors : * shouldPrintErrs ,
84
84
}
85
85
if ! * skipdata {
86
86
if err := reader .All (ctx ); err != nil {
@@ -145,7 +145,7 @@ func run(ctx context.Context, args []string) error {
145
145
go func () {
146
146
defer wg .Done ()
147
147
if err := g .generatePluginsIndexPage (categories , pluginsByPath , featuredPlugins ); err != nil {
148
- if * errs == true {
148
+ if * shouldPrintErrs {
149
149
log .Println (errors .Wrap (err , "generatePluginsIndexPage" ))
150
150
}
151
151
}
@@ -154,7 +154,7 @@ func run(ctx context.Context, args []string) error {
154
154
go func () {
155
155
defer wg .Done ()
156
156
if err := g .generateCategoriesJSON (categories ); err != nil {
157
- if * errs == true {
157
+ if * shouldPrintErrs {
158
158
log .Println (errors .Wrap (err , "generateCategoriesJSON" ))
159
159
}
160
160
}
@@ -163,7 +163,7 @@ func run(ctx context.Context, args []string) error {
163
163
go func () {
164
164
defer wg .Done ()
165
165
if err := g .generateCategoryPluginsJSONFiles (categories , pluginsByPath ); err != nil {
166
- if * errs == true {
166
+ if * shouldPrintErrs {
167
167
log .Println (errors .Wrap (err , "generateCategoryPluginsJSONFiles" ))
168
168
}
169
169
}
@@ -172,7 +172,7 @@ func run(ctx context.Context, args []string) error {
172
172
go func () {
173
173
defer wg .Done ()
174
174
if err := g .generateCategoryPages (categories , categories , pluginsByPath ); err != nil {
175
- if * errs == true {
175
+ if * shouldPrintErrs {
176
176
log .Println (errors .Wrap (err , "generateCategoryPages" ))
177
177
}
178
178
}
@@ -181,7 +181,7 @@ func run(ctx context.Context, args []string) error {
181
181
go func () {
182
182
defer wg .Done ()
183
183
if err := g .generatePluginPages (categories , plugins ); err != nil {
184
- if * errs == true {
184
+ if * shouldPrintErrs {
185
185
log .Println (errors .Wrap (err , "generatePluginPages" ))
186
186
}
187
187
}
@@ -190,7 +190,7 @@ func run(ctx context.Context, args []string) error {
190
190
go func () {
191
191
defer wg .Done ()
192
192
if err := g .generateContributorPages (categories , pluginsByPath ); err != nil {
193
- if * errs == true {
193
+ if * shouldPrintErrs {
194
194
log .Println (errors .Wrap (err , "generateContributorPages" ))
195
195
}
196
196
}
@@ -199,7 +199,7 @@ func run(ctx context.Context, args []string) error {
199
199
go func () {
200
200
defer wg .Done ()
201
201
if err := g .generateFeaturedPluginsJSON (featuredPlugins ); err != nil {
202
- if * errs == true {
202
+ if * shouldPrintErrs {
203
203
log .Println (errors .Wrap (err , "generateFeaturedPluginsJSON" ))
204
204
}
205
205
}
@@ -208,7 +208,7 @@ func run(ctx context.Context, args []string) error {
208
208
go func () {
209
209
defer wg .Done ()
210
210
if err := g .generateContributorsPage (categories , plugins ); err != nil {
211
- if * errs == true {
211
+ if * shouldPrintErrs {
212
212
log .Println (errors .Wrap (err , "generateContributorsPage" ))
213
213
}
214
214
}
@@ -227,13 +227,13 @@ func run(ctx context.Context, args []string) error {
227
227
if ! * nodocs {
228
228
articles , err = generateDocs (ctx )
229
229
if err != nil {
230
- if * errs == true {
230
+ if * shouldPrintErrs {
231
231
log .Println (errors .Wrap (err , "generateDocs" ))
232
232
}
233
233
}
234
234
}
235
235
if err := g .generateSitemap (categories , pluginsByPath , articles , * out ); err != nil {
236
- if * errs == true {
236
+ if * shouldPrintErrs {
237
237
log .Println (errors .Wrap (err , "generateSitemap" ))
238
238
}
239
239
}
@@ -423,6 +423,9 @@ func (g *generator) generateContributorPage(categories map[string]metadata.Categ
423
423
return err
424
424
}
425
425
g .peopleCycleIndex , err = peopleCycle .Print (os .Stdout , g .peopleCycleIndex )
426
+ if err != nil {
427
+ return err
428
+ }
426
429
fmt .Print ()
427
430
return nil
428
431
}
0 commit comments