Skip to content

Commit

Permalink
Allow webpages to have an empty config (#3417)
Browse files Browse the repository at this point in the history
  • Loading branch information
doriable authored Oct 23, 2024
1 parent 39b1dc4 commit 81698bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion private/bufpkg/bufcobra/bufcobra.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func run(
if err != nil {
return err
}

excludes := slicesext.ToStructMap(config.ExcludeCommands)
for _, command := range cobraCommand.Commands() {
if _, ok := excludes[command.CommandPath()]; ok {
Expand Down
4 changes: 2 additions & 2 deletions private/bufpkg/bufcobra/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ type config struct {
}

func readConfigFromFile(path string) (*config, error) {
var webpagesConfig config
if path == "" {
return nil, nil
return &webpagesConfig, nil
}
file, err := os.Open(path)
if err != nil {
Expand All @@ -57,7 +58,6 @@ func readConfigFromFile(path string) (*config, error) {
if err != nil {
return nil, err
}
var webpagesConfig config
if err := yaml.Unmarshal(data, &webpagesConfig); err != nil {
return nil, err
}
Expand Down

0 comments on commit 81698bb

Please sign in to comment.