-
-
Notifications
You must be signed in to change notification settings - Fork 640
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 command-level and task-level warning #352
Conversation
Hi @parkerduckworth, thanks for the PR! 🙂 The code seems simple enough to be worth adding this. I'll probably check this in another day, though... In the meantime, can you change the base branch from |
Absolutely! |
8f51d3a
to
a0abd48
Compare
Ok @andreynering , everything looks to be in order! |
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.
Hi @parkerduckworth,
Sorry for the wait, been busy recently...
Some comments so far:
- I think that
prompt
may be a better name thanwarning
. What do you think? - I think it's a bit inconsistent that command prompts skips the command while task prompts makes it error. I think both should have the same behavior, and I believe the right behavior would be to skip the task. Sounds good?
- Many CLI tools have a
-y
argument to bypass prompts and execute then without asking. This is important to allow executing these commands on CI, for example. - [Optional] A small section on the documentation about this would be nice. But if you don't want to do it, I'll after the merge
@andreynering no worries, life is to be lived!
I think that So maybe an example would be like this: tasks:
example-task:
desc: An example
prompt: Are you sure you want to run this task? (y/N) I think the answer depends on whether or not we want more flexibility here. You have obviously spent much more time than I working with this codebase, so I would happily agree with your preference.
Excellent! So shall it be.
I agree! We should provide this affordance as well.
Ha! I would be more than happy to write up the docs for this!! If you are good with all my above remarks, I will make these changes and push them up. |
Thinking better, let's keep On the other points, I think we agree about them, so feel free to proceed =) |
Requested changes have been made 👍 |
Hey @andreynering, you mind sharing why this was closed? |
@parkerduckworth Sorry, this was a mistake For some reason GitHub closed many PRs after merging #220 Reopening... |
Hello @andreynering ! Is this feature still going to be merged? |
Hey @andreynering , this is actually no longer necessary, as I was able to get Any chance we can cut a new release with the updated Thank you! |
@parkerduckworth Sorry for not responding to you all this time. Life happens. Good to hear that the |
@andreynering apology not necessary 🙂 Hope all is well mate! |
Hey @andreynering, just saw your comment on issue #100 regarding the pending upstream ability to pass a
-p
flag toread
. Coincidentally, I just finished writing this patch before your reply.I understand that mdvan/sh#551 will clear up the ability to add a prompt, but I think that having an explicit
warning
option at both task and command levels may improve this tool. What do you think?Here is how
warning
can be used at both levels:Declining to run a command with a command-level warning results in the command being skipped, and the rest of the commands in the task (without warnings) will run unhindered.
I know you will have this project's best interest in mind. Thanks for considering this feature!