compose icon indicating copy to clipboard operation
compose copied to clipboard

Cannot run service commands containing a colon

Open Brewal opened this issue 2 years ago • 3 comments

Are you certain it's a bug?

  • [X] Yes, it looks like a bug

Are you using the latest version?

  • [X] Yes, I'm using the latest version

Is there an existing issue for this?

  • [X] I have searched existing issues, it hasn't been reported yet

Issue description

When trying to run a command with compose that contains a : character, it seems to be replaced with a space. I tried to escape the colon, put the command between double quotes, ... with no luck.

Same goes with the shortcut alternative :

serverless api:bref:cli --args="list"

Service configuration (serverless-compose.yml) content

services:
  api:
    path: api

Command name and used flags

serverless bref:cli --service=api --args="list"

Command output

Error:
Serverless command "bref cli" not found. Did you mean "bref:cli"? Run "serverless help" for a list of all available commands.

Brewal avatar Aug 02 '23 11:08 Brewal

@Brewal that is related to how Bref commands look (they follow the Symfony Console pattern so that they look more familiar to PHP devs).

Long story short, they are not supported by Serverless Compose because of that :.

mnapoli avatar Aug 02 '23 15:08 mnapoli

Thanks for the response ! So I understand that this won't be fix and that there's no other workaround than cd into the corresponding service directory and use the regular serverless command ?

I'm a bit curious about why this is a limitation :)

Brewal avatar Aug 02 '23 15:08 Brewal

I think so yes. One way to fix this would be to update Bref's repo to support both bref:cli and bref cli, that would be doable I think.

mnapoli avatar Aug 07 '23 07:08 mnapoli