my npm script needs to run sed to replace some string, e.g.
"prebuild":"sed 's/http:\/\/example.com/https:\/\/something_real.com/' < static/config.js.example > static/config.js",
"build": "node build/build.js"
But the backsplash escapes are interpreted by shell when run npm run build
, so I got the error,
qiulang$ npm run build
> sed 's/http://example.com/https://something_real/' < static/config.js.example > static/config.js
sed: 1: "s/http://emicall-cmb.em ...": bad flag in substitute command: 'e'
So how do I prevent shell from doing that ?