Skip to content

Commit

Permalink
only create adhoc gen when -T flag is present
Browse files Browse the repository at this point in the history
  • Loading branch information
verdverm committed Jul 10, 2022
1 parent fced38d commit 7efd560
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
9 changes: 6 additions & 3 deletions lib/gen/gen.go
Expand Up @@ -80,9 +80,12 @@ func runGen(args []string, rootflags flags.RootPflagpole, cmdflags flags.GenFlag
return fmt.Errorf("\nErrors while loading generators\n")
}
}
err = R.CreateAdhocGenerator()
if err != nil {
return err

if LT > 0 {
err = R.CreateAdhocGenerator()
if err != nil {
return err
}
}


Expand Down
8 changes: 5 additions & 3 deletions lib/gen/runtime.go
Expand Up @@ -73,9 +73,11 @@ func (R *Runtime) Reload(fast bool) error {
return fmt.Errorf("\nErrors while loading generators\n")
}

err = R.CreateAdhocGenerator()
if err != nil {
return err
if len(R.Flagpole.Template) > 0 {
err = R.CreateAdhocGenerator()
if err != nil {
return err
}
}

return nil
Expand Down
3 changes: 2 additions & 1 deletion notes/curr.md
Expand Up @@ -3,7 +3,8 @@ v0.6.3
- [x] better watch regen message
- [x] disjunct ordered models
- [x] --watch-templates & clear function
- [ ] only do adhoc things if needed

- [x] only do adhoc things if needed (when a `-T` flag is present)
- [ ] --as-module flag (also --create-module) or --module-* flags? (including subgens from -G)
- [ ] list / info flags (for available gens, or maybe just part of help?)
- [ ] record demo
Expand Down

0 comments on commit 7efd560

Please sign in to comment.