jovotech / jovo-cli

🛠 Command Line Interface for the Jovo Framework: Makes voice experience deployment a breeze, including features like local development and staging.
https://www.jovo.tech/marketplace/jovo-cli
Apache License 2.0
57 stars 31 forks source link

🔨 Check for serverless args order #360

Open ilovelinux opened 1 year ago

ilovelinux commented 1 year ago

Proposed changes

Since arguments passed to jovo deploy:code serverless {args} are used only on an index-based logic (see code referenced in the issue), they need to be put after serverless.

The additional code checks the order of the arguments before running the deployment. When they are not in the right order, it raises an exception with an explicit and meaningful message about how to use the command in the right way.

Fixes https://github.com/jovotech/jovo-cli/issues/358

Note: there may be better error messages than the one I chose. Feel free to change it accordingly.

Types of changes

Checklist

ilovelinux commented 1 year ago

I put this PR in WIP as I wanted to test its behavior with jovo build:serverless --deploy command, but I can't manage to make it run. I get the same error with the published package, I think it's unrelated to the PR.

Error ``` % jovo build:serverless --deploy jovo build:serverless: Build serverless configuration file. >> Learn more: https://jovo.tech/marketplace/target-serverless ✔ Generating serverless.yaml >> ./serverless.yaml x Error: -------------------------------------------------------------------------------- › › Message: › Cannot read properties of undefined (reading 'includes') › › Module: › JovoCliCore › › › If you think this is not on you, you can submit an issue here: https://github.com/jovotech/jovo-cli/issues. ```