-
Notifications
You must be signed in to change notification settings - Fork 964
Init template #2728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Init template #2728
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution @dhuckins! I actually like this feature a lot 🚀
Please, see my comment below.
cmd/internal/base/base.go
Outdated
"ent init --template '<template string>'", | ||
"ent init --template file=path/to/tmpl.tmpl", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"ent init --template '<template string>'", | |
"ent init --template file=path/to/tmpl.tmpl", | |
"ent init --template file=path/to/file.tmpl User", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, let's not support string template atm. It's not supported by ent generate
and I don't see a use case for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought I saw it elsewhere (?)
took a second look and couldn't find, will remove
cmd/internal/base/base.go
Outdated
var target string | ||
var newSchemaTemplate string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var target string | |
var newSchemaTemplate string | |
var target, tmpl string |
Keep variable names short please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Looks good. Please address the minor comments and let's merge it.
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
@a8m suggestions applied! needs an approval from a contributor to run CI checks thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this feature a lot! Thanks again for adding this ❤️
Please, you are welcome to join our Discord community. |
allows
ent init ...
to accept template string/file for new model creation