feat: check command input is valid array
Issue #, if available:
Description of changes:
Commands that include spaces within arguments, special characters, or need quoting can break if naively split on whitespace(command.split(' ')) .
Take for example this input:
alembic revision --autogenerate -m "Your message here".
Splitting on whitespace will result in container def receving the command
[ "alembic", "revision", "--autogenerate", " -m", "Your", "message", " here"] which is incorrect and will result in an error when the command is run.
This PR solves this by validating that the command input is a valid array and adding it to the container definition. Otherwise an error is thrown.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
@iamhopaul123 can you review this please? Thanks!
Hi @SimplyFaisal, thank you so much for your contribution. Apologies on the delay. We will be working on reviewing Pull Requests on the repositories. In the mean time please ensure that below steps, if not already done, are taken care of in your PR:
-
Verify if PR follows semantic pull request conventions.
-
Please run npm run package command to update dist/ folder with latest dependencies.
-
Resolve merge conflicts on the PR
Thanks for the info @amazreech. Confirming that the above requests are satisfied.
Hi @SimplyFaisal, I have added few comments to clarify my understand of the solution provided here. Please do respond with your thoughts.
Also, the unit tests seem to be failing for this, would you also be able to take a look at that.
@SimplyFaisal @amazreech any progress on this PR? this bug makes our service crash