Following sed command works on Linux and Windows but fails on MacOS/BSD:
sed -i '/"appId"/c\ \"appId":\ \"'${applicationId}'\",' $capacitorConfigJson
I tried to add ' ' -e
sed -i ' ' -e '/"appId"/c\ \"appId":\ \"'${applicationId}'\",' $capacitorConfigJson
and then script fail with error:
sed: 1: "/"appId"/c\ \"appId":\ ...": extra characters after \ at the end of c command
I found similar solutions to add newline after c\ but it doesn't seems to work.
Try this on BSD (OSX) sed
:
sed -i.bak '/"appId"/c\
"appId": "'${applicationId}'",
' "$capacitorConfigJson"
Note that there is a space after c\
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments