Closed ddeboer closed 1 year ago
This is a current limitation of the bref:cli command.
To work around that, you can use serverless invoke directly, see this for the used options https://github.com/brefphp/bref/blob/651523ecfef982ba5d2299f5580b39b400c1a617/plugin/run-console.js#L7-L12
Maybe the current command could support a --function option in case there are multiple console functions available
Maybe the current command could support a --function option in case there are multiple console functions available
Yep, that would be the simplest solution.
It should be easy to contribute if you can to give it a try
😄 I honestly thought it would be a very rare scenario, so I didn't plan for this in the v2 release. I wasn't expecting this to come up so fast :D
Maybe the current command could support a --function option in case there are multiple console functions available
Sounds perfect!
oh wow, the PR is here already ❤️
Yep, long live open source. 😄
Out of curiosity: why did you consider this scenario rare? I would expect more users to have both a console and a cron/schedule function that invokes CLI commands, for example when using a framework like Symfony.
Out of curiosity: why did you consider this scenario rare? I would expect more users to have both a console and a cron/schedule function that invokes CLI commands, for example when using a framework like Symfony.
That makes a lot of sense… I use one for both, but I could totally see how one would want to separate them!
Description:
If you have two or more functions using the
console
layer, for example a console and a cron function, Bref 2 throws an error when invokingbref:cli
:I didn’t find a way to manually provide the function name, as was used on Bref 1.
How to reproduce:
Configure at least two functions using the
console
layer, for example:Then run: