Shopware 6: How to update the messenger.yaml with Docker exec in Git Bash using sed command

43 views Asked by At

I'm running a Bash script on Windows Git Bash that uses docker exec to update the messenger.yaml file in my Shopware container. I am encountering an issue with a sed command in my bash script, and I am seeking help to resolve it. I have the following sed command in my script:

FIND="# 'App\\Message\\YourMessage':"
REPLACE='Swag\\CodePlugin\\ScheduledTask\\SendCodePluginInvitationTask:'

docker exec $SHOPWARE_CONTAINER_ID sed -i "s/$FIND/$REPLACE/g" $FILE

when I run the script, I receive the following error:

sed: -e expression #1, char 36: unknown option to `s'

When I change this "# 'App\\Message\\YourMessage':" to "'App\\Message\\YourMessage':" it changes the content of the file. But I want to remove # as well.

Any help or suggestions on how to correct this sed command would be greatly appreciated.

Thank you!

0

There are 0 answers