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 method _chainOrCall to return the promise result. #1907
Comments
I might be misunderstanding your question, so ask again if this answer does not make sense. Commander does not expect the action handler to return a response, other than a promise if it is async. You might well think it does based on the For interest, you can see the action handler response was ignored before support for async was added. This is the PR adding the first version of async support: https://github.com/tj/commander.js/pull/1118/files |
The link to #1118 was more relevant than I expected, it looks like you were relying on that implementation to indirectly get the action response, although Again, the internal variable name could lead to incorrect assumptions. Sorry about that. But the public facing API has the action handler returning void: commander.js/typings/index.d.ts Line 497 in 4ef19fa
|
Thanks for your response. |
Hi, I am the developper of a nestjs module using commander nestjs-console
Our module is built to partially wrap your module logic into a nestjs module.
We were extracting response from the command until the new version.
commander.js/lib/command.js
Lines 1301 to 1305 in 4ef19fa
As you can see here, actionResult will always returns undefined.
Can we add a line to return the result ?
I could help opening a PR if you want.
Thx
The text was updated successfully, but these errors were encountered: