Skip to content

Commit

Permalink
cmd/mecha: skip non-Go directories in modules when building.
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <ron@hybridgroup.com>
  • Loading branch information
deadprogram committed Mar 10, 2024
1 parent cbb33aa commit 7303f6e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/mecha/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ func build(cCtx *cli.Context) error {
if !f.IsDir() {
continue
}
// check if there is a go.mod file in the directory
_, err = os.Stat(filepath.Join(wd, "modules", f.Name(), "go.mod"))
if err != nil {
fmt.Println("No Go files to build in", f.Name(), "skipping...")
continue
}

if err := buildModule(filepath.Join(wd, "modules"), f.Name()); err != nil {
return err
}
Expand Down

0 comments on commit 7303f6e

Please sign in to comment.