skip to Main Content

I’m running a Bash script on Windows Git Bash that uses docker exec to set config values in my Shopware container:

docker exec -d $SHOPWARE_CONTAINER_ID php bin/console system:config:set $PLUGIN_NAME.config.active true

But I get an error that the config value must be a boolean, not a string.
It seems passing "true" from Bash sets it as a string, when it needs to be a proper bool value. How can I properly set a boolean config value true/false from a Bash script using docker exec?

2

Answers


  1. Chosen as BEST ANSWER

    I solved this issue by using -j (-json) to decode the true as a bool.

    docker exec  $SHOPWARE_CONTAINER_ID php bin/console system:config:set -j $PLUGIN_NAME.config.active true
    

  2. There’s seems to be a decode option added on this commit
    https://github.com/shopware/shopware/pull/2209/commits/e4d49e20248be3e770860297417ef5a87b7fb686#diff-a041d80e81de3a24e5d1b155454509b67b3c5c0d72732b311a00aa47fccefbe1R33

    It allows an input value to be interpreted as JSON and therefore be converted to boolean. I believe it can be used like this --decode or -d

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search