-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Executing "run" no longer works to forward to other commands #602
Comments
Hi and thank you for this issue. However - I do not want this latest change to break anything, but I am not sure yet I fully understand why it breaks. I will need to dig deeper into it. For now, I suggest this:
I have looked at the change and I am a bit relieved - I thought it was related to the #596. |
Yeah, no - I do not like it either. For some reason I thought you were calling the commands themselves ( It is nice to just be able to call "run ..." and have the script just execute as if it was called externally, but it was definitely not designed to do this - as you notice. If we make any change to support this - then it will be official, formal, and fully tested for future regression. Personally - I usually avoid such pattern, and instead, create my functions in the lib directory, and then any other function can call them as isolated units, completely bypassing the CLI entrypoint. Is that something that you relate to? |
Yeah, that is what I will probably do in the next couple of days. Thanks for your feedback and have a nice day :) P.S. You may close this if you like |
No, keep it open. If it doesn't behave as you expect, I consider it at least a pseudo-bug. |
@Neunerlei see the associated PR - I am reverting (and slightly improving) the change, since I did not think about this nice use case of yours when I made it. I am beginning to wonder if there is any need for I still need to complete some tests and documentation for it, but you can consider it reverted. It would help if you can test this unreleased version, to ensure your use case is indeed back in the green. Thanks for the ticket and for your support. |
Description
Hello there,
first of all thanks for creating this awesome tool, which I use basically in every project I work on.
I wrote quite a few cli tools running with bashly and really loved the possibility to create a command that forwards to another command if needed.
E.g. I have a environment control script with a
npm install
command, which first should execute thedocker up
command. Until now I did this by callingrun docker up
, followed by arun docker exec npm install
in thenpm install
command.Yes, I know I was using internals here, but I found it to be an amazing tool to reuse commands in an atomic pattern that did not involve rebooting the whole script over and over.
However, the latest change: 9167c49
breaks this behavior, because input and args are no longer reset, which currently breaks all scripts.
I'm currently considering my options here and wanted to ask if you could point me in a direction to fix this.
I'm currently thinking about creating a custom "forward_to" function in my library code which restores the old variable resetting, but that will be a lot of refactoring. 🤔
Alternatively I would like to kindly ask if you would consider rolling back the change to the previous behavior?
Thank you in any way!
edit: here is a bit of source code as context:
bashly.yaml
up_command.sh
ssh_command.sh
composer_command.sh
The text was updated successfully, but these errors were encountered: