-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Improve custom commands interface #2109
Improve custom commands interface #2109
Conversation
Code looks good, could you add an integration test for this? You can use https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/tests/custom_commands/multiple_prompts.go as a reference. Also check out https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md Lemme know if you need any guidance |
Hi @jesseduffield, I would be happy to give it a shot. |
fdbf94f
to
6a906c9
Compare
{ | ||
Key: "a", | ||
Context: "files", | ||
Command: `echo "{{index .Form.FileContent}}" > {{index .Form.FileName}}`, |
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.
is the index
thing here necessary?
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.
It looks like I forgot to remove it. I updated the code now
Add Form field to CustomCommandObjects struct Write user prompts responses to Form field Ensure that map keys exists Add form prompts integration test Remove redundant index
cf82366
to
7e9dffe
Compare
Thanks for waiting for my re-review. Great work! |
I'm glad that I could contribute to this cool project! |
Allow a name to be specified in the prompt so that prompts can be referred by name.
Referring to prompt responses by index is kept in the code for backwards compatibility.
Add functionality for returning an error if the referred prompt is not defined.
This resolves: #2103