-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Allow execution of hubot command from CLI #613
Comments
Or this would be satisfactory, if anyone is aware of a simple tweak to make it work:
|
Yeah, this would definitely be useful 👍 It'd probably be easier to do this with the |
Awesome. I'll investigate when I get some time! |
@patcon are you wanting this for testing purposes? If so, I think this can be closed. If not, can you further explain your use case? |
Some good old unix-fu gets it done already:
ps1. run 'apt-get install expect' in case you get 'expect: command not found' |
This doesn't directly address the command line execution, but #800 added persisted history to the shell adapter. That way, you can quit and restart hubot, press up to get the last command, and re-run it. |
@technicalpickles nice to meet you, but are you sure you read patcon's request?
I guess you were more thinking about your own manual usecases? Anyways, afaik he would like the shell-adapter to accept messages from commandline invocation.
by doing so he can easily use 'process.env.USER' and 'process.env.CMD' in his patch. |
@coderofsalvation I am sure I read it, thank you! I only mentioned what I did because it is a similar realm of making hubot development easier. Supporting something like using the shell adapter is going to be difficult to handle because of the async nature of javascript. Once a message is received in the Given that, a single message being processed, there's no good way to know when the listener is really done right now. There's some async libraries out there to help with that (I have one in mind, but can't place it right now), where you call a |
@technicalpickles Thanks for your reply. I fully agree with your observations. That's why i mentioned the hubot-http-script npm package. It uses hubot's express-implementation, which seems to work around this the async-issue already. |
I wonder if this might help with problems that folks are encountering from some IDEs when trying to run in debug mode (like #648). At present, you need to run |
I would like to see this feature too! +1 to @coderofsalvation's unix-foo in the meantime, that worked for me (ie, the |
thnx. For anyone interested, meanwhile i use:
as i turned it into a commandscript hubottest |
I mentioned knowing when a script was done was one problem. I mention another over in #904
Basically, hubot doesn't currently know when the scripts are loaded, so that it could |
The |
I'm interested in programmatically running some quick hubot commands in the interest of auto-generating documentation.
Ideally, would be great to add an argument to the shell adapter that would allow this (with the sample script):
The text was updated successfully, but these errors were encountered: