Skip to content

Commit

Permalink
feat: avoid running maintenance on non-compatible projects
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Apr 24, 2021
1 parent 5579631 commit d2b9739
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion maintenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,18 @@ func doMaintenanceOnce(_ context.Context, path string) error {
return fmt.Errorf("not implemented: git checkout master/main")
}

// TODO: check if the worktree looks like the corresponding template
// check if the project looks like a one that can be maintained by repoman
{
var errs error
for _, expected := range []string{"Makefile", "rules.mk"} {
if !u.FileExists(filepath.Join(project.Path, expected)) {
errs = multierr.Append(errs, fmt.Errorf("missing file: %q", expected))
}
}
if errs != nil {
return fmt.Errorf("project is not compatible with repoman: %w", errs)
}
}

// TODO
// - repoman.yml ->
Expand Down

0 comments on commit d2b9739

Please sign in to comment.