Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add generate templates command #1242
Add generate templates command #1242
Changes from 16 commits
8bf521e
d6a51ba
86d6ea7
9e8d8e7
54e52d6
8efa0c7
06433cf
d4aa5e5
f231c5e
be0ae7d
d8df7a6
a8cf73f
44ceeb8
0d4e0ec
106ef48
4983141
3ce0087
cff1357
deb8540
d5f20ea
3a2eec6
4dd7808
7b48f13
020da9f
d8ecd49
5b076c4
19608ba
2adf137
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
flow-cli has the
--save
-s
flag to save the output of a command to a file, do we need to have this logic here or can we just return the output and rely on that logic?also state has a ReaderWriter that is used to save files and that is used elsewhere instead of os functions.
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.
Hmm yeah I guess that means that you always have to provide
--save
. I was hoping to just always generate them to the correct folders unless specified otherwise. But it makes sense to keep the same pattern. Just really verbose now. Writingflow generate contract woohoo --save cadence/contracts/whoohoo.cdc
is so long that I'd almost rather just write the cadence instead of use this command. Makes me want to kill this PR.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.
Imo just skip the pattern/flag here. I think think it's pretty obvious that this will be saving a file and using a flag for this is just redundant & a command like this is for ease of use so should be as shorthand as possible. I think the only purpose
--save
potentially has in this is as an override to the output path.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'm fully in support for super short aliases here as well (i.e.
flow g c FooBar
)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.
Feel free to not use --save. But using ReaderWriter is recommended. I think it also creates required directories.
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.
Yeah ReaderWriter is no problem. Good catch. Will change that @bjartek